This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58248] [4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Aug 2013 07:55:25 +0000
- Subject: [Bug tree-optimization/58248] [4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-58248-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58248
--- Comment #5 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to Jakub Jelinek from comment #4)
> No, the only change I've made to this testcase was instead of using
> printf use if (c != 1) __builtin_abort ();.
I checked the modified test case below:
---------
struct S
{
int u;
};
int a = 1, b, c = 1, e, *f, *g;
static struct S d = {6};
void foo (int *p)
{
c &= a != *p;
}
int main ()
{
struct S h = d;
int **i = &f;
*i = g = &b;
for (; h.u; h.u--)
{
for (e = 0; e < 2; e++)
{
foo (*i);
*g = 0 > **i;
}
*f = 0;
}
if (c != 1)
__builtin_abort ();
return 0;
}
---------
The log:
$ gcc-trunk -O3 small.c
$ a.out
Aborted (core dumped)
$ gcc-trunk -O2 small.c
$ a.out
$ gcc-4.8 -O3 small.c
$ a.out
$
> If you can, next time please try to adjust the testcases such that they
> abort if miscompiled and exit with 0 exit status otherwise, gcc testsuite
> usually doesn't check for output from the testcases.
Got it; will do.