Bug 14518 - [non-unit-at-a-time] Trivial failure with IMA at -O0
Summary: [non-unit-at-a-time] Trivial failure with IMA at -O0
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Andrew Pinski
URL:
Keywords: wrong-code
Depends on: 15816
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-10 23:43 UTC by Dale Johannesen
Modified: 2004-09-09 23:41 UTC (History)
2 users (show)

See Also:
Host: powerpc-apple-darwin7.2.0
Target: powerpc-apple-darwin7.2.0
Build: powerpc-apple-darwin7.2.0
Known to work:
Known to fail: 4.0 tree-ssa
Last reconfirmed: 2004-03-10 23:55:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Johannesen 2004-03-10 23:43:05 UTC
The following is a failure with IMA on fairly basic stuff.  Compile the files together as
cc -O0 -c -o foo.o file1.c file2.c
You get a multiply defined symbol in the .s file.  This goes away with -O2 or higher.

There should probably be an IMA component, I don't think this is the last problem
we'll have with it (and Geoff insists it's not an optimization, so that's inappropriate).

/* file 1 */
char *globals[] = {"a", "b"};
foo() {
  printf("%s\n", globals[0]);
}

/* file 2 */
extern char *globals[];
main() {
  printf("%s\n", globals[1]);
}
Comment 1 Andrew Pinski 2004-03-10 23:55:49 UTC
Confirmed, also happens on 3.5.0.
Comment 2 Andrew Pinski 2004-03-10 23:57:27 UTC
I wish non unit-at-a-time mode will be removed.
Comment 3 Andrew Pinski 2004-06-18 04:40:31 UTC
Will be fixed when I get IMA working again.
Comment 4 Andrew Pinski 2004-06-18 04:42:45 UTC
I should say that it is working in my local compiler which has IMA semi working.
Comment 5 Andrew Pinski 2004-07-15 01:57:45 UTC
Fixed in 3.5.0.