Bug 43495 - gcc.c-torture/execute/20000603-1.c fails with -fpic/-fPIC
Summary: gcc.c-torture/execute/20000603-1.c fails with -fpic/-fPIC
Status: RESOLVED DUPLICATE of bug 14319
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-23 17:41 UTC by Kaveh Ghazi
Modified: 2021-07-29 18:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.5, 4.4.4
Known to fail: 4.5.0
Last reconfirmed: 2010-03-24 10:20:10


Attachments
testcase with inlined f() fails at x86_64-linux (201 bytes, text/plain)
2010-04-08 15:35 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kaveh Ghazi 2010-03-23 17:41:45 UTC
When running the testsuite on ia64-unknown-linux-gnu with extra passes
containing -fpic/-fPIC I get the following additional error on the 4.5 trunk:

FAIL: gcc.c-torture/execute/20000603-1.c execution,  -O2
FAIL: gcc.c-torture/execute/20000603-1.c execution,  -O3 -fomit-frame-pointer
FAIL: gcc.c-torture/execute/20000603-1.c execution,  -O3 -g
FAIL: gcc.c-torture/execute/20000603-1.c execution,  -Os

This is a regressions from previous releases.

Testsuite results showing the extra error:
http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg01997.html
Comment 1 Kaveh Ghazi 2010-03-23 19:05:34 UTC
Testcase also fails on powerpc-unknown-linux-gnu with -fpic/-fPIC:

http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg01630.html

Comment 2 Kaveh Ghazi 2010-03-23 22:17:51 UTC
Testcase also fails on sparc64-unknown-linux-gnu with -fpic/-fPIC in both 32 and 64 bit modes:

http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg00753.html
Comment 3 Richard Biener 2010-03-24 10:20:09 UTC
The test is bogus and does not agree with how GCC interprets type-based
aliasing rules.  Thus it invokes undefined behavior (dependent on whether
we inline or not).
Comment 4 Kaveh Ghazi 2010-03-24 18:11:00 UTC
OK, I'll modify the testcase to ensure function f() gets inlined.
Comment 5 Zdenek Sojka 2010-04-08 15:35:13 UTC
Created attachment 20336 [details]
testcase with inlined f() fails at x86_64-linux

Even when the f() is declared as

static inline __attribute__((always_inline))
double f(struct s1 *a, struct s2 *b)

the testcase still fails with:
$ gcc -fschedule-insns -fstrict-aliasing pr43495-2.c && ./a.out
Aborted
Comment 6 Zdenek Sojka 2010-04-08 15:38:07 UTC
Testcase from comment #5 fails at x86_64-linux, trunk r153685, r158095.
It doesn't fail in the 4.4 branch.
Comment 7 Andrew Pinski 2021-07-29 18:55:13 UTC
Just going to make this as a dup of bug 14319.

*** This bug has been marked as a duplicate of bug 14319 ***