Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
> On Oct 2, 2024, at 12:05, Jakub Jelinek wrote: > > On Wed, Oct 02, 2024 at 11:48:16AM -0400, Marek Polacek wrote: >>> + error_at (DECL_SOURCE_LOCATION (field_decl), >>> + "argument %qE to the %qE attribute is not a field declaration" >>> + " in the same structure as %qD", fieldname, >>>

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
> On Oct 2, 2024, at 11:48, Marek Polacek wrote: > > On Wed, Oct 02, 2024 at 03:26:26PM +, Qing Zhao wrote: >> From: qing zhao >> >> When handling the counted_by attribute, if the corresponding field >> doesn't exit, in additiion to issue error, we should also remove >> the already added

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Jakub Jelinek
On Wed, Oct 02, 2024 at 11:48:16AM -0400, Marek Polacek wrote: > > + error_at (DECL_SOURCE_LOCATION (field_decl), > > + "argument %qE to the %qE attribute is not a field declaration" > > + " in the same structure as %qD", fieldname, > > + (get_attribute_name (attr

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Marek Polacek
On Wed, Oct 02, 2024 at 03:26:26PM +, Qing Zhao wrote: > From: qing zhao > > When handling the counted_by attribute, if the corresponding field > doesn't exit, in additiion to issue error, we should also remove > the already added non-existing "counted_by" attribute from the > field_decl. >

[PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
From: qing zhao When handling the counted_by attribute, if the corresponding field doesn't exit, in additiion to issue error, we should also remove the already added non-existing "counted_by" attribute from the field_decl. bootstrapped and regression tested on both x86 and aarch64. Okay for comm