Bug 48761 - Indirect inlining needs to perform type checking
Summary: Indirect inlining needs to perform type checking
Status: RESOLVED DUPLICATE of bug 48763
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: mozillametabug
  Show dependency treegraph
 
Reported: 2011-04-25 15:47 UTC by Jan Hubicka
Modified: 2011-04-26 10:08 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-26 10:05:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hubicka 2011-04-25 15:47:44 UTC
Hi,
I believe that the following bug is not preventing Mozilla from building with LTO. Though I did not reduced the testcase, yet, I can easily reproduce similar bug. I will still look into Mozilla testcase as I can not imagine this to match on any sane code.

Martin/Richi, at some point we need to test type compatibility after declaring
edge direct and possible set the uninlinable flag.  Bit tricky to do as the call type is not easily accessible from the indirect edge.

Honza

evans:/abuild/jh/trunk-3/build-inst5/gcc/:[1]$ cat ~/t.c
struct a{
  double b;
};
double a(struct a b)
{
  return b.b;
}

callptr(int (*p)(int))
{
   p(10);
}
main()
{
  callptr (a);
}
evans:/abuild/jh/trunk-3/build-inst5/gcc/:[0]$ ./xgcc -B ./ -O3 ~/t.c -fno-early-inlining -S
/root/t.c: In function 'main':
/root/t.c:15:3: warning: passing argument 1 of 'callptr' from incompatible pointer type [enabled by default]
/root/t.c:9:1: note: expected 'int (*)(int)' but argument is of type 'double (*)(struct a)'
/root/t.c:13:1: error: conversion of register to a different size
VIEW_CONVERT_EXPR<struct a>(D.2717_2);

# .MEM_4 = VDEF <.MEM_1(D)>
b = VIEW_CONVERT_EXPR<struct a>(D.2717_2);

/root/t.c:13:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2011-04-26 10:05:37 UTC
We need to delay this checking to expand_call_inline ().
Comment 2 Richard Biener 2011-04-26 10:08:55 UTC
dup

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