* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
@ 2014-10-27 19:05 ` vbraun.name at gmail dot com
2014-10-27 19:18 ` vbraun.name at gmail dot com
` (29 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: vbraun.name at gmail dot com @ 2014-10-27 19:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #1 from Volker Braun <vbraun.name at gmail dot com> ---
Created attachment 33822
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33822&action=edit
Output of gcc -v
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
2014-10-27 19:05 ` [Bug target/63661] " vbraun.name at gmail dot com
@ 2014-10-27 19:18 ` vbraun.name at gmail dot com
2014-10-28 9:01 ` rguenth at gcc dot gnu.org
` (28 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: vbraun.name at gmail dot com @ 2014-10-27 19:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #2 from Volker Braun <vbraun.name at gmail dot com> ---
Created attachment 33823
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33823&action=edit
Preprocessed source
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
2014-10-27 19:05 ` [Bug target/63661] " vbraun.name at gmail dot com
2014-10-27 19:18 ` vbraun.name at gmail dot com
@ 2014-10-28 9:01 ` rguenth at gcc dot gnu.org
2014-10-28 10:46 ` vbraun.name at gmail dot com
` (27 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-28 9:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2014-10-28
Ever confirmed|0 |1
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
What function from the libm library ends up getting used for you? (none is
used on x86_64-linux for me)
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (2 preceding siblings ...)
2014-10-28 9:01 ` rguenth at gcc dot gnu.org
@ 2014-10-28 10:46 ` vbraun.name at gmail dot com
2014-10-28 12:08 ` howarth at bromo dot med.uc.edu
` (26 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: vbraun.name at gmail dot com @ 2014-10-28 10:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #4 from Volker Braun <vbraun.name at gmail dot com> ---
Good point, -lm is not necessary. It was necessary in the original GSL
testsuite case, but I removed that part.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (3 preceding siblings ...)
2014-10-28 10:46 ` vbraun.name at gmail dot com
@ 2014-10-28 12:08 ` howarth at bromo dot med.uc.edu
2014-10-28 12:12 ` howarth at bromo dot med.uc.edu
` (25 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
howarth at bromo dot med.uc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |howarth at bromo dot med.uc.edu
--- Comment #5 from howarth at bromo dot med.uc.edu ---
Interestingly, I find on Yosemite that the system gcc produces...
% gcc -O0 -g -o test_mathieu test_mathieu.c -lm && ./test_mathieu
loop -2.35802
loop 2
loop 2
loop 2
loop 2
for -O0/-O1/-O2 when -g is used.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (4 preceding siblings ...)
2014-10-28 12:08 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:12 ` howarth at bromo dot med.uc.edu
2014-10-28 12:13 ` howarth at bromo dot med.uc.edu
` (24 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #6 from howarth at bromo dot med.uc.edu ---
My mistake, I assumed the first output line was an error.
loop -2.35802
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (5 preceding siblings ...)
2014-10-28 12:12 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:13 ` howarth at bromo dot med.uc.edu
2014-10-28 12:14 ` howarth at bromo dot med.uc.edu
` (23 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #7 from howarth at bromo dot med.uc.edu ---
Created attachment 33828
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33828&action=edit
assembly at -O2 from test_mathieu.c using clang as gcc in Xcode 6
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (6 preceding siblings ...)
2014-10-28 12:13 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:14 ` howarth at bromo dot med.uc.edu
2014-10-28 12:24 ` howarth at bromo dot med.uc.edu
` (22 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #8 from howarth at bromo dot med.uc.edu ---
Created attachment 33829
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33829&action=edit
assembly at -O2 from test_mathieu.c using gcc 4.9.1-RC
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (7 preceding siblings ...)
2014-10-28 12:14 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:24 ` howarth at bromo dot med.uc.edu
2014-10-28 12:27 ` howarth at bromo dot med.uc.edu
` (21 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #9 from howarth at bromo dot med.uc.edu ---
Created attachment 33830
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33830&action=edit
assembly at -O1 from test_mathieu.c using gcc 4.9.1-RC
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (8 preceding siblings ...)
2014-10-28 12:24 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:27 ` howarth at bromo dot med.uc.edu
2014-10-28 12:44 ` howarth at bromo dot med.uc.edu
` (20 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #10 from howarth at bromo dot med.uc.edu ---
for the testcase compiled with clang as gcc at -O2 on Yosemite
% setenv DYLD_PRINT_BINDINGS
% ./test_mathieu
dyld: bind: libgcc_s.1.dylib:0x1098E0000 = libdyld.dylib:dyld_stub_binder,
*0x1098E0000 = 0x7FFF9B4612A0
dyld: bind: test_mathieu:0x1098C8000 = libdyld.dylib:dyld_stub_binder,
*0x1098C8000 = 0x7FFF9B4612A0
dyld: resolver at 0x7fff9002924f returned 0x7FFF90029160
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB710 =
libsystem_platform.dylib:__platform_strchr, *0x7FFF7D8BB710 = 0x7FFF90029160
dyld: resolver at 0x7fff9002927a returned 0x7FFF9002D240
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6E8 =
libsystem_platform.dylib:__platform_memmove, *0x7FFF7D8BB6E8 = 0x7FFF9002D240
dyld: resolver at 0x7fff9002927a returned 0x7FFF9002D240
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6F0 =
libsystem_platform.dylib:__platform_memmove, *0x7FFF7D8BB6F0 = 0x7FFF9002D240
dyld: lazy bind: test_mathieu:0x1098C8010 = libsystem_c.dylib:_printf,
*0x1098C8010 = 0x7FFF8DA9C930
dyld: resolver at 0x7fff90028cad returned 0x7FFF90028B20
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6D8 =
libsystem_platform.dylib:__platform_memchr, *0x7FFF7D8BB6D8 = 0x7FFF90028B20
loop -2.35802
loop 2.35802
loop 2.35802
loop 2.35802
loop 2.35802
for the testcase compiled with gcc 4.9.2-RC at -O2 on Yosemite
% setenv DYLD_PRINT_BINDINGS
% ./test_mathieu
dyld: bind: test_mathieu:0x103E32010 = libsystem_c.dylib:___stack_chk_guard,
*0x103E32010 = 0x7FFF7D8BF070
dyld: bind: test_mathieu:0x103E32000 = libdyld.dylib:dyld_stub_binder,
*0x103E32000 = 0x7FFF9B4612A0
dyld: resolver at 0x7fff9002924f returned 0x7FFF90029160
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB710 =
libsystem_platform.dylib:__platform_strchr, *0x7FFF7D8BB710 = 0x7FFF90029160
dyld: resolver at 0x7fff9002927a returned 0x7FFF9002D240
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6E8 =
libsystem_platform.dylib:__platform_memmove, *0x7FFF7D8BB6E8 = 0x7FFF9002D240
dyld: resolver at 0x7fff9002927a returned 0x7FFF9002D240
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6F0 =
libsystem_platform.dylib:__platform_memmove, *0x7FFF7D8BB6F0 = 0x7FFF9002D240
dyld: lazy bind: test_mathieu:0x103E32028 = libsystem_c.dylib:_printf,
*0x103E32028 = 0x7FFF8DA9C930
dyld: resolver at 0x7fff90028cad returned 0x7FFF90028B20
dyld: lazy bind: libsystem_c.dylib:0x7FFF7D8BB6D8 =
libsystem_platform.dylib:__platform_memchr, *0x7FFF7D8BB6D8 = 0x7FFF90028B20
loop -2.35802
loop 2
loop 2
loop 2
loop 2
dyld: resolver at 0x7fff90028e1a returned 0x7FFF9002DD10
dyld: lazy bind: test_mathieu:0x103E32018 = libsystem_platform.dylib:___bzero,
*0x103E32018 = 0x7FFF9002DD10
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (9 preceding siblings ...)
2014-10-28 12:27 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 12:44 ` howarth at bromo dot med.uc.edu
2014-10-28 14:36 ` rguenth at gcc dot gnu.org
` (19 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-28 12:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #11 from howarth at bromo dot med.uc.edu ---
This issue isn't specific to Yosemite. I also see the failure at -O2 with
gcc-4.9.1 on darwin13.4.0 using the cctools (as and ld) from Xcode 6.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (10 preceding siblings ...)
2014-10-28 12:44 ` howarth at bromo dot med.uc.edu
@ 2014-10-28 14:36 ` rguenth at gcc dot gnu.org
2014-10-28 14:40 ` [Bug target/63661] [4.9/5 Regression] " rguenth at gcc dot gnu.org
` (18 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-28 14:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
Status|WAITING |NEW
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Reproduces with -O2 -fPIC -mtune=nehalem on x86_64-linux for me.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (11 preceding siblings ...)
2014-10-28 14:36 ` rguenth at gcc dot gnu.org
@ 2014-10-28 14:40 ` rguenth at gcc dot gnu.org
2014-10-29 8:01 ` jakub at gcc dot gnu.org
` (17 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-28 14:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.8.3
Target Milestone|--- |4.9.2
Summary|-O2 miscompiles on OSX |[4.9/5 Regression] -O2
|10.10 Yosemite |miscompiles on OSX 10.10
| |Yosemite
Known to fail| |4.9.1, 5.0
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
4.8 doesn't know nehalem but works with -mtune=native (where 4.9 and 5 break).
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (12 preceding siblings ...)
2014-10-28 14:40 ` [Bug target/63661] [4.9/5 Regression] " rguenth at gcc dot gnu.org
@ 2014-10-29 8:01 ` jakub at gcc dot gnu.org
2014-10-29 8:20 ` jakub at gcc dot gnu.org
` (16 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-29 8:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jamborm at gcc dot gnu.org,
| |vmakarov at gcc dot gnu.org
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r204698 , you can use -O2 -fpic -mtune=corei7 in compilers that
don't grok -mtune=nehalem.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (13 preceding siblings ...)
2014-10-29 8:01 ` jakub at gcc dot gnu.org
@ 2014-10-29 8:20 ` jakub at gcc dot gnu.org
2014-10-30 10:37 ` jakub at gcc dot gnu.org
` (15 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-29 8:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly reduced testcase:
static void
foo (double a, double q, double xx, double *ff, double *gx, int e, int ni)
{
int ii, nn;
double g1 = *gx;
ff[ni] = xx;
if (e == 0)
{
for (ii = 0; ii < ni; ii++)
{
nn = 100 - ii - 1;
ff[ni - ii - 1]
= -1.0 / ((4 * (nn + 1) * (nn + 1) - a) / q + ff[ni - ii]);
}
}
else
{
for (ii = 0; ii < ni; ii++)
{
nn = 100 - ii - 1;
ff[ni - ii - 1]
= -1.0 / (((2 * nn + 1) * (2 * nn + 1) - a) / q + ff[ni - ii]);
}
}
*gx = ff[0] - g1;
}
int
bar (int order, double q, double a, double c[])
{
int ni, nn, i, e;
double eps, g1, g2, x1, x2, e1, e2, de, xh, s, ratio, ff[100];
eps = 1e-10;
c[0] = 1.0;
e = 0;
if (order % 2 != 0)
e = 1;
if (q == 0.0)
{
for (i = 0; i < 100; i++)
c[i] = 0.0;
c[(order - 1) / 2] = 1.0;
return 0;
}
if (order < 5)
{
nn = 0;
s = 0.0;
if (e == 0)
ratio = (a - 4) / q;
else
ratio = (a - 1 - q) / q;
}
else
{
if (e == 0)
{
c[1] = (a - 4) / q;
s = 2 * c[0] + 4 * c[1];
for (i = 2; i < order / 2; i++)
{
c[i] = (a - 4 * i * i) / q * c[i - 1] - c[i - 2];
s += 2 * (i + 1) * c[i];
}
}
else
{
c[1] = (a - 1) / q + 1;
s = c[0] + 3 * c[1];
for (i = 2; i < order / 2 + 1; i++)
{
c[i] = (a - (2 * i - 1) * (2 * i - 1)) / q * c[i - 1] - c[i - 2];
s += (2 * (i + 1) - 1) * c[i];
}
}
nn = i - 1;
ratio = c[nn] / c[nn - 1];
}
ni = 100 - nn - 1;
if (e == 0)
x1 = -q / (4.0 * (100 + 1.0) * (100 + 1.0));
else
x1 = -q / ((2.0 * 100 + 1.0) * (2.0 * 100 + 1.0));
g1 = ratio;
foo (a, q, x1, ff, &g1, e, ni);
x2 = g1;
g2 = ratio;
while (1)
{
__builtin_printf ("loop %g\n", g2);
e1 = g1 - x1;
e2 = g2 - x2;
de = e1 - e2;
if (__builtin_fabs (de) < eps)
break;
xh = (e1 * x2 - e2 * x1) / de;
x1 = x2;
g1 = g2;
x2 = xh;
g2 = ratio;
foo (a, q, x2, ff, &g2, e, ni);
}
s += 2 * (nn + 1) * c[nn];
for (i = nn + 1; i < 100; i++)
{
c[i] = ff[i - nn - 1] * c[i - 1];
s += 2 * (i + 1) * c[i];
if (__builtin_fabs (c[i]) < 1e-20)
for (; i < 100;)
c[i++] = 0.0;
}
for (i = 0; i < 100; i++)
c[i] /= s;
return 0;
}
int
main ()
{
double c[100];
bar (1, 5.0, -5.790080598637771, c);
return 0;
}
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (14 preceding siblings ...)
2014-10-29 8:20 ` jakub at gcc dot gnu.org
@ 2014-10-30 10:37 ` jakub at gcc dot gnu.org
2014-10-30 18:27 ` vbraun.name at gmail dot com
` (14 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-30 10:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.9.2 |4.9.3
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.2 has been released.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (15 preceding siblings ...)
2014-10-30 10:37 ` jakub at gcc dot gnu.org
@ 2014-10-30 18:27 ` vbraun.name at gmail dot com
2014-10-31 10:28 ` jamborm at gcc dot gnu.org
` (13 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: vbraun.name at gmail dot com @ 2014-10-30 18:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Volker Braun <vbraun.name at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.9.2
--- Comment #17 from Volker Braun <vbraun.name at gmail dot com> ---
Bug is still in gcc 4.9.2
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (16 preceding siblings ...)
2014-10-30 18:27 ` vbraun.name at gmail dot com
@ 2014-10-31 10:28 ` jamborm at gcc dot gnu.org
2014-11-03 3:02 ` mednafen at gmail dot com
` (12 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-10-31 10:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #18 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #14)
> Started with r204698 , you can use -O2 -fpic -mtune=corei7 in compilers that
> don't grok -mtune=nehalem.
So it's probably mine. I will take a look but please be patient, it
may take a week or probably two.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles on OSX 10.10 Yosemite
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (17 preceding siblings ...)
2014-10-31 10:28 ` jamborm at gcc dot gnu.org
@ 2014-11-03 3:02 ` mednafen at gmail dot com
2014-11-21 17:51 ` [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7 jamborm at gcc dot gnu.org
` (11 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: mednafen at gmail dot com @ 2014-11-03 3:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
mednafen at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mednafen at gmail dot com
--- Comment #19 from mednafen at gmail dot com ---
Created attachment 33870
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33870&action=edit
Simplified testcase.
Simplified testcase, tested to be broken on x86_64 Linux.
$ /usr/local/gcc-4.9.2/bin/gcc -O2 -fpic -o testcase-alt testcase-alt.c &&
./testcase-alt
A: 0x00007fffd8416f60
B: 0x4014000000000000 ---- 5
$ /usr/local/gcc-4.9.2/bin/gcc -O2 -fpic -mtune=nehalem -o testcase-alt
testcase-alt.c && ./testcase-alt
A: 0x00007fffc9fb1730
B: 0x00007fffc9fb1730 ---- 6.95331e-310
Aborted
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (18 preceding siblings ...)
2014-11-03 3:02 ` mednafen at gmail dot com
@ 2014-11-21 17:51 ` jamborm at gcc dot gnu.org
2014-11-21 21:15 ` hjl.tools at gmail dot com
` (10 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-11-21 17:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #20 from Martin Jambor <jamborm at gcc dot gnu.org> ---
So had a look at what my tiny bit in IRA does with this testcase and
while it certainly triggers the bug, I don't think it causes it. It
performs exactly the same modifications as when -mtune=nehalem is not
specified on the command line.
The functions I introduced split life-ranges of three registers, an SI
mode one, DF mode one and a DI mode one. The bug occurs when both the
latter two (DF and DI mode) are split.
One suspicious thing is that in the nehalem case, the DF register is
assigned to r12 (as opposed to a stack spill in the non-nehalem case)
but I think that register is killed before being used, and
(coincidentally?) it is being overwritten by the value from the
DI-life-split register (r15) - in what seems like another effort of
IRA to split their life-range but with one crucial instruction being
lost (as in not present after reload).
I'm afraid I'll need help of someone who knows IRA, Vladimir, could
you please have a look at what happens in function bar during IRA and
reload?
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (19 preceding siblings ...)
2014-11-21 17:51 ` [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7 jamborm at gcc dot gnu.org
@ 2014-11-21 21:15 ` hjl.tools at gmail dot com
2014-11-24 12:22 ` jamborm at gcc dot gnu.org
` (9 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-21 21:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #21 from H.J. Lu <hjl.tools at gmail dot com> ---
It was fixed by r217783 on trunk and the fix also works
on 4.9 branch. Is is the real fix?
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (20 preceding siblings ...)
2014-11-21 21:15 ` hjl.tools at gmail dot com
@ 2014-11-24 12:22 ` jamborm at gcc dot gnu.org
2014-11-24 13:41 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-11-24 12:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |renlin.li at arm dot com
--- Comment #22 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #21)
> It was fixed by r217783 on trunk and the fix also works
> on 4.9 branch. Is is the real fix?
I am not familiar enough with IRA to be really sure but I would say
that yes. This bug really looks as if IRA and LRA chose the same
register (r12) for a different thing, which is described as the
problem in the email accompanying the patch. The weird sequence
clobbering the register certainly goes away with just this patch
applied.
So let's wait for a week or so if any of the RA people confirm this or
have any comments and prepare a backport if they don't.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (21 preceding siblings ...)
2014-11-24 12:22 ` jamborm at gcc dot gnu.org
@ 2014-11-24 13:41 ` rguenth at gcc dot gnu.org
2014-11-26 16:11 ` renlin.li at arm dot com
` (7 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 13:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Priority|P3 |P2
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (22 preceding siblings ...)
2014-11-24 13:41 ` rguenth at gcc dot gnu.org
@ 2014-11-26 16:11 ` renlin.li at arm dot com
2014-11-28 11:02 ` renlin at gcc dot gnu.org
` (6 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: renlin.li at arm dot com @ 2014-11-26 16:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #23 from Renlin Li <renlin.li at arm dot com> ---
I am using x86_64-unknown-linux-gnu-gcc toolchain.
Reproduce the issue in 4.9 branch with "-O2 -fPIC -mtune=native" options.
With 4.9.2 release, I reproduced the problem with "-O2 -fPIC -mtune=nehalem"
options.
I have verified that, after my patch(r217783), both cases are fixed.
Issue is not there anymore in the latest trunk, it is presumably fixed by my
patch already.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (23 preceding siblings ...)
2014-11-26 16:11 ` renlin.li at arm dot com
@ 2014-11-28 11:02 ` renlin at gcc dot gnu.org
2014-11-28 11:19 ` renlin at gcc dot gnu.org
` (5 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: renlin at gcc dot gnu.org @ 2014-11-28 11:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #24 from renlin at gcc dot gnu.org ---
Author: renlin
Date: Fri Nov 28 11:01:27 2014
New Revision: 218143
URL: https://gcc.gnu.org/viewcvs?rev=218143&root=gcc&view=rev
Log:
Add testcase for PR63661.
2014-11-28 Renlin Li <renlin.li@arm.com>
PR target/63661
* gcc.target/i386/pr63661.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr63661.c
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (24 preceding siblings ...)
2014-11-28 11:02 ` renlin at gcc dot gnu.org
@ 2014-11-28 11:19 ` renlin at gcc dot gnu.org
2014-11-28 21:22 ` vbraun.name at gmail dot com
` (4 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: renlin at gcc dot gnu.org @ 2014-11-28 11:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #25 from renlin at gcc dot gnu.org ---
Author: renlin
Date: Fri Nov 28 11:18:47 2014
New Revision: 218144
URL: https://gcc.gnu.org/viewcvs?rev=218144&root=gcc&view=rev
Log:
Use native tune. nehalem is not able to triggle the issue in trunk any more.
2014-11-28 Renlin Li <renlin.li@arm.com>
PR target/63661
* gcc.target/i386/pr63661.c: Use native tune.
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/i386/pr63661.c
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (25 preceding siblings ...)
2014-11-28 11:19 ` renlin at gcc dot gnu.org
@ 2014-11-28 21:22 ` vbraun.name at gmail dot com
2014-12-01 13:08 ` [Bug target/63661] [4.9 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: vbraun.name at gmail dot com @ 2014-11-28 21:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #26 from Volker Braun <vbraun.name at gmail dot com> ---
I can confirm that r217783 fixes the original issue on in the GSL testsuite on
OSX Yosemite, too.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (26 preceding siblings ...)
2014-11-28 21:22 ` vbraun.name at gmail dot com
@ 2014-12-01 13:08 ` jakub at gcc dot gnu.org
2014-12-01 18:34 ` jamborm at gcc dot gnu.org
` (2 subsequent siblings)
30 siblings, 0 replies; 32+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-01 13:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |5.0
Summary|[4.9/5 Regression] -O2 |[4.9 Regression] -O2
|miscompiles with |miscompiles with
|-mtune=nehalem or corei7 |-mtune=nehalem or corei7
Known to fail|5.0 |
--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thus fixed on the trunk so far.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (27 preceding siblings ...)
2014-12-01 13:08 ` [Bug target/63661] [4.9 " jakub at gcc dot gnu.org
@ 2014-12-01 18:34 ` jamborm at gcc dot gnu.org
2014-12-03 11:14 ` renlin at gcc dot gnu.org
2014-12-03 16:03 ` renlin.li at arm dot com
30 siblings, 0 replies; 32+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-12-01 18:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |renlin.li at arm dot com
--- Comment #28 from Martin Jambor <jamborm at gcc dot gnu.org> ---
In https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02502.html Renlin
said he wanted to prepare the backport himself so I'll take the
liberty of assigning the bug to him. Please close this bug once it
hits the 4.9 branch. Thanks a lot.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (28 preceding siblings ...)
2014-12-01 18:34 ` jamborm at gcc dot gnu.org
@ 2014-12-03 11:14 ` renlin at gcc dot gnu.org
2014-12-03 16:03 ` renlin.li at arm dot com
30 siblings, 0 replies; 32+ messages in thread
From: renlin at gcc dot gnu.org @ 2014-12-03 11:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
--- Comment #29 from renlin at gcc dot gnu.org ---
Author: renlin
Date: Wed Dec 3 11:13:50 2014
New Revision: 218306
URL: https://gcc.gnu.org/viewcvs?rev=218306&root=gcc&view=rev
Log:
Backported from mainline
gcc/
2014-12-03 Renlin Li <Renlin.Li@arm.com>
PR middle-end/63762
PR target/63661
* ira.c (i386ra): Update preferred class.
gcc/testsuite/
2014-12-03 Renlin Li <Renlin.Li@arm.com>
H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/63762
PR target/63661
* gcc.dg/pr63762.c: New test.
* gcc.target/i386/pr63661.c: New test.
Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr63762.c
branches/gcc-4_9-branch/gcc/testsuite/gcc.target/i386/pr63661.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/ira.c
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Bug target/63661] [4.9 Regression] -O2 miscompiles with -mtune=nehalem or corei7
2014-10-27 19:03 [Bug target/63661] New: -O2 miscompiles on OSX 10.10 Yosemite vbraun.name at gmail dot com
` (29 preceding siblings ...)
2014-12-03 11:14 ` renlin at gcc dot gnu.org
@ 2014-12-03 16:03 ` renlin.li at arm dot com
30 siblings, 0 replies; 32+ messages in thread
From: renlin.li at arm dot com @ 2014-12-03 16:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661
Renlin Li <renlin.li at arm dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #30 from Renlin Li <renlin.li at arm dot com> ---
4.9 branch is fixed by r218306
trunk is fixed by r217783
^ permalink raw reply [flat|nested] 32+ messages in thread