public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/63184] New: [4.8/4.9/5 Regression] Fails to simplify comparison
@ 2014-09-05  8:32 rguenth at gcc dot gnu.org
  2014-09-05  8:34 ` [Bug middle-end/63184] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-05  8:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63184

            Bug ID: 63184
           Summary: [4.8/4.9/5 Regression] Fails to simplify comparison
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org

c-c++-common/pr19807-2.c

/* { dg-do link } */

extern void link_error(void);
int i;
int main()
{
  int a[4];
  if ((char*)&a[1] + 4*i + 4 != (char*)&a[i+2])
    link_error();
  return 0;
}

Fails with all optimization levels for all compilers.

c-c++-common/pr19807-3.c

/* { dg-do link } */

extern void link_error(void);
int i;
int main()
{
  int a[4];
  if (&a[1] + i + 1 != &a[i+2])
    link_error();
  return 0;
}

gcc 4.7 passes with -O[01] but fails with -O2+
gcc 4.8 and 4.9 fail with -O0 but passes with -O1+ (thanks to SLSR)
gcc 5.0 since the fix for PR63148 fails

which is a regression.

We don't seem to systematically use sth like the tree-affine.c framework
to simplify address comparisons and the fact that tree-reassoc.c doesn't
in any way associate pointer arithmetic doesn't help either.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-06  7:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05  8:32 [Bug middle-end/63184] New: [4.8/4.9/5 Regression] Fails to simplify comparison rguenth at gcc dot gnu.org
2014-09-05  8:34 ` [Bug middle-end/63184] " rguenth at gcc dot gnu.org
2014-10-17 11:29 ` rguenth at gcc dot gnu.org
2014-11-24 13:17 ` rguenth at gcc dot gnu.org
2015-04-22 12:01 ` [Bug middle-end/63184] [4.8/4.9/5/6 " jakub at gcc dot gnu.org
2015-07-16  9:13 ` [Bug middle-end/63184] [4.9/5/6 " rguenth at gcc dot gnu.org
2021-05-14  9:47 ` [Bug middle-end/63184] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2021-09-05 23:59 ` pinskia at gcc dot gnu.org
2021-09-06  1:10 ` pinskia at gcc dot gnu.org
2021-09-06  5:31 ` pinskia at gcc dot gnu.org
2021-09-06  7:47 ` cvs-commit at gcc dot gnu.org
2021-09-06  7:48 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).