Bug 37756 - ICE building object file with -O3 and -combine
Summary: ICE building object file with -O3 and -combine
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-10-06 21:23 UTC by Jonathan Briggs
Modified: 2010-09-17 09:06 UTC (History)
3 users (show)

See Also:
Host: i386-redhat-linux
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-10-08 00:29:07


Attachments
Gzipped Tar of .i files for bug reproduction (121.98 KB, application/octet-stream)
2008-10-06 21:25 UTC, Jonathan Briggs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Briggs 2008-10-06 21:23:27 UTC
# gcc *.i -combine -O3 -c -o udns.o
dia-submit/udns_init.c: In function ‘dns_set_srch_internal’:
dia-submit/udns_init.c:47: internal compiler error: in get_addr_dereference_operands, at tree-ssa-operands.c:1698

Because it only appears to happen when building with multiple input files, I have attached a tar of .i files that reproduce the problem (the udns async DNS resolver library actually).

I have observed this ICE on i386 and x86_64 and IA64 builds of GCC 4.3.2.
Comment 1 Jonathan Briggs 2008-10-06 21:25:29 UTC
Created attachment 16465 [details]
Gzipped Tar of .i files for bug reproduction
Comment 2 Richard Biener 2008-10-07 07:38:49 UTC
Unlikely to be fixed.  -combine is an obscure feature.
Comment 3 Andrew Pinski 2008-10-07 20:40:04 UTC
(In reply to comment #2)
> Unlikely to be fixed.  -combine is an obscure feature.

Except it might not be a -combine issue :).  Until the bug gets reduced/analyzed we cannot say it will unlikely be fixed. 
Comment 4 Andrew Pinski 2008-10-08 00:29:07 UTC
Reduced testcase.
FILE 1:
struct dns_ctx {
  int dnsc_serv[6];
  unsigned dnsc_nserv;
};
struct dns_ctx dns_defctx;
int dns_add_serv(int t) {
  struct dns_ctx *ctx = &dns_defctx;
  ctx->dnsc_serv[t] = 0;
}

--- CUT ---
FILE 2:
extern struct dns_ctx dns_defctx;

--- CUT ---
Though I am still figuring out if this is valid code or not really, dns_defctx's type is incomplete.
Comment 5 Jonathan Briggs 2008-10-08 00:54:17 UTC
I think you missed some of your explanation.  

Do you mean that it may not be valid to take the address of a global struct with partial definition? For example in udns_init.c which does not define dns_defctx, but has this code:

int dns_init(struct dns_ctx *ctx, int do_open) {
  if (!ctx)
    ctx = &dns_defctx;
[...]
Comment 6 Richard Biener 2010-09-17 09:06:37 UTC
-combine has been removed from GCC 4.6 in favor of LTO, closing as WONTFIX.