Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-08-03 Thread Joseph Myers
On Wed, 1 Aug 2018, Bogdan Harjoc wrote: > > seen_error () is the idiomatic way of testing whether an error has been > > reported. > > The updated patch is attached and includes a test that passes with: > > make check-gcc RUNTESTFLAGS="dg.exp=union-duplicate-field.c" Thanks, committed. -- J

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-08-01 Thread Bogdan Harjoc
On Wed, Aug 1, 2018 at 1:20 AM, Joseph Myers wrote: > On Wed, 1 Aug 2018, Bogdan Harjoc wrote: > >> So array[0] < component < array[2], which loops (I removed the gdb p >> commands for field_array[1] and so on). > > Is the key thing here that you end up with DECL_NAME (field) == NULL_TREE, > but D

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-31 Thread Joseph Myers
On Wed, 1 Aug 2018, Bogdan Harjoc wrote: > So array[0] < component < array[2], which loops (I removed the gdb p > commands for field_array[1] and so on). Is the key thing here that you end up with DECL_NAME (field) == NULL_TREE, but DECL_NAME (field_array[bot]) != NULL_TREE - and in this particu

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-31 Thread Bogdan Harjoc
#define foo(a) did it, thanks! As Joseph suspected, the hang/no hang result depended on the values of DECL_NAME pointers: - with #define foo(a) plus the testcase from bugzilla id 86690 and no -save-temps, the "return s.a" that triggers lookup_field() will find the sorted field_array containing:

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-31 Thread Joseph Myers
On Tue, 31 Jul 2018, Bogdan Harjoc wrote: > With fresh git sources and contrib/gcc_update the tests pass: > > === gcc Summary === > > # of expected passes 133500 > # of expected failures 422 > # of unsupported tests 2104 > > gcc-build/gcc/xgcc version 9.0.0 20180730 (experimental) (GCC) > > I

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-31 Thread Richard Sandiford
Hi, Thanks for submitting the patch. Bogdan Harjoc writes: > With fresh git sources and contrib/gcc_update the tests pass: > > === gcc Summary === > > # of expected passes 133500 > # of expected failures 422 > # of unsupported tests 2104 > > gcc-build/gcc/xgcc version 9.0.0 20180730 (experiment

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-31 Thread Bogdan Harjoc
With fresh git sources and contrib/gcc_update the tests pass: === gcc Summary === # of expected passes 133500 # of expected failures 422 # of unsupported tests 2104 gcc-build/gcc/xgcc version 9.0.0 20180730 (experimental) (GCC) I wasn't able to reduce the input to avoid including and as it on

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-07-27 Thread Joseph Myers
On Fri, 27 Jul 2018, Bogdan Harjoc wrote: > If a struct contains an anonymous union and both have a field with the > same name, detect_field_duplicates_hash() will replace one of them > with NULL. If compilation doesn't stop immediately, it may later call > lookup_field() on the union, which false