This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Extend former fold_widened_comparison to all integral types
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Oct 2015 10:53:15 +0100
- Subject: Re: [patch] Extend former fold_widened_comparison to all integral types
- Authentication-results: sourceware.org; auth=none
- References: <4651194 dot MC4K6VP4qm at polaris>
On Mon, Oct 26, 2015 at 9:39 AM, Eric Botcazou <ebotcazou@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 <ebotcazou@adacore.com>
>
> * match.pd (fold_widened_comparison): Apply simplifications to
> all integral types.
>
>
> 2015-10-26 Eric Botcazou <ebotcazou@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