On Mon, Oct 26, 2015 at 9:39 AM, Eric Botcazou <ebotca...@adacore.com> wrote: > Hi, > > this patch extends the simplification formerly done in fold_widened_comparison > and now in match.pd to all integral types instead of just integer types, and > comes with an Ada testcase for the enumeral type case. > > The patch introduces a failure in the C testsuite: > > FAIL: gcc.dg/atomic-noinline.c execution test > > because the testcase is broken: > > /* The fake external function should return 10. */ > if (__atomic_is_lock_free (4, 0) != 10) > abort (); > > __atomic_is_lock_free returns a boolean so it cannot return 10... > > Tested on x86_64-suse-linux, OK for the mainline?
I think excluding enums had sth to do with C++ -f[no-]strict-enums (whatever is the default). Just tried to figure where the check came from ... both calls are keyed on INTEGER_TYPE... OTOH if testing passes then the patch is obviously ok. Thanks, Richard. > > 2015-10-26 Eric Botcazou <ebotca...@adacore.com> > > * match.pd (fold_widened_comparison): Apply simplifications to > all integral types. > > > 2015-10-26 Eric Botcazou <ebotca...@adacore.com> > > * gcc.dg/atomic-noinline.c: Fix test on __atomic_is_lock_free. > * gcc.dg/atomic-noinline-aux.c: Fix its return type. > * gnat.dg/opt51.adb: New test. > * gnat.dg/opt51_pkg.ads: New helper. > > > -- > Eric Botcazou