diff mbox

[lto] Fix the mis-matched arguments of lto_define_builtins

Message ID 000e01cfb224$7ba8caa0$72fa5fe0$@arm.com
State New
Headers show

Commit Message

Bin Cheng Aug. 7, 2014, 9:46 a.m. UTC
Hi,
As analyzed in PR62032, this patch fixes the latent lto bug by switching
arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
arm/aarch64 with lto options.

Is it ok if bootstrap and test pass?


2014-08-07  Bin Cheng  <bin.cheng@arm.com>

	PR lto/62032
	* lto/lto-lang.c (lto_init): Switch mis-matched arguments.

Comments

Richard Biener Aug. 7, 2014, 12:06 p.m. UTC | #1
On Thu, Aug 7, 2014 at 11:46 AM, Bin Cheng <bin.cheng@arm.com> wrote:
> Hi,
> As analyzed in PR62032, this patch fixes the latent lto bug by switching
> arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
> arm/aarch64 with lto options.
>
> Is it ok if bootstrap and test pass?

Ok (would be nice if you can check if LTO bootstrap still works).

Thanks,
Richard.

>
> 2014-08-07  Bin Cheng  <bin.cheng@arm.com>
>
>         PR lto/62032
>         * lto/lto-lang.c (lto_init): Switch mis-matched arguments.
Bin.Cheng Aug. 8, 2014, 8:05 a.m. UTC | #2
On Thu, Aug 7, 2014 at 8:06 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Thu, Aug 7, 2014 at 11:46 AM, Bin Cheng <bin.cheng@arm.com> wrote:
>> Hi,
>> As analyzed in PR62032, this patch fixes the latent lto bug by switching
>> arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
>> arm/aarch64 with lto options.
>>
>> Is it ok if bootstrap and test pass?
>
> Ok (would be nice if you can check if LTO bootstrap still works).
Done.  Bootstrap with "--with-build-config=bootstrap-lto" works fine.
I will commit this to trunk and wait for couple of days before
back-port to 4_9 branch.  Is that OK?

BTW, I found GCC trunk@213701 failed when building ada with below ICE
message, so I have to do the bootstrap with ada disabled.

../../gcc/gcc/ada/exp_ch3.adb: In function 'exp_ch3__get_simple_init_val':
../../gcc/gcc/ada/exp_ch3.adb:7695:4: internal compiler error: in
forward_edge_to_pdom, at tree-ssa-dce.c:1042
    function Get_Simple_Init_Val
    ^
0xc23a8d forward_edge_to_pdom
../../gcc/gcc/tree-ssa-dce.c:1042
0xc23c21 remove_dead_stmt
../../gcc/gcc/tree-ssa-dce.c:1091
0xc24120 eliminate_unnecessary_stmts
../../gcc/gcc/tree-ssa-dce.c:1218
0xc24b23 perform_tree_ssa_dce
../../gcc/gcc/tree-ssa-dce.c:1460
0xc24c1c tree_ssa_cd_dce
../../gcc/gcc/tree-ssa-dce.c:1501
0xc24d86 execute
../../gcc/gcc/tree-ssa-dce.c:1566
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [/tmp/cc4oj0WO.ltrans1.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [gnat1] Error 1
make[3]: *** Waiting for unfinished jobs....

Thanks,
bin
Richard Biener Aug. 8, 2014, 8:54 a.m. UTC | #3
On Fri, Aug 8, 2014 at 10:05 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Thu, Aug 7, 2014 at 8:06 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Thu, Aug 7, 2014 at 11:46 AM, Bin Cheng <bin.cheng@arm.com> wrote:
>>> Hi,
>>> As analyzed in PR62032, this patch fixes the latent lto bug by switching
>>> arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
>>> arm/aarch64 with lto options.
>>>
>>> Is it ok if bootstrap and test pass?
>>
>> Ok (would be nice if you can check if LTO bootstrap still works).
> Done.  Bootstrap with "--with-build-config=bootstrap-lto" works fine.
> I will commit this to trunk and wait for couple of days before
> back-port to 4_9 branch.  Is that OK?

Sure.

> BTW, I found GCC trunk@213701 failed when building ada with below ICE
> message, so I have to do the bootstrap with ada disabled.

Heh - I usually do LTO bootstrap only for c,c++,fortran as otherwise it
takes ages... ;)

Richard.

> ../../gcc/gcc/ada/exp_ch3.adb: In function 'exp_ch3__get_simple_init_val':
> ../../gcc/gcc/ada/exp_ch3.adb:7695:4: internal compiler error: in
> forward_edge_to_pdom, at tree-ssa-dce.c:1042
>     function Get_Simple_Init_Val
>     ^
> 0xc23a8d forward_edge_to_pdom
> ../../gcc/gcc/tree-ssa-dce.c:1042
> 0xc23c21 remove_dead_stmt
> ../../gcc/gcc/tree-ssa-dce.c:1091
> 0xc24120 eliminate_unnecessary_stmts
> ../../gcc/gcc/tree-ssa-dce.c:1218
> 0xc24b23 perform_tree_ssa_dce
> ../../gcc/gcc/tree-ssa-dce.c:1460
> 0xc24c1c tree_ssa_cd_dce
> ../../gcc/gcc/tree-ssa-dce.c:1501
> 0xc24d86 execute
> ../../gcc/gcc/tree-ssa-dce.c:1566
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> make[4]: *** [/tmp/cc4oj0WO.ltrans1.ltrans.o] Error 1
> lto-wrapper: fatal error: make returned 2 exit status
> compilation terminated.
> /usr/bin/ld: lto-wrapper failed
> collect2: error: ld returned 1 exit status
> make[3]: *** [gnat1] Error 1
> make[3]: *** Waiting for unfinished jobs....
>
> Thanks,
> bin
Bin.Cheng Aug. 8, 2014, 9 a.m. UTC | #4
On Fri, Aug 8, 2014 at 4:54 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Fri, Aug 8, 2014 at 10:05 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
>> On Thu, Aug 7, 2014 at 8:06 PM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, Aug 7, 2014 at 11:46 AM, Bin Cheng <bin.cheng@arm.com> wrote:
>>>> Hi,
>>>> As analyzed in PR62032, this patch fixes the latent lto bug by switching
>>>> arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
>>>> arm/aarch64 with lto options.
>>>>
>>>> Is it ok if bootstrap and test pass?
>>>
>>> Ok (would be nice if you can check if LTO bootstrap still works).
>> Done.  Bootstrap with "--with-build-config=bootstrap-lto" works fine.
>> I will commit this to trunk and wait for couple of days before
>> back-port to 4_9 branch.  Is that OK?
>
> Sure.
>
>> BTW, I found GCC trunk@213701 failed when building ada with below ICE
>> message, so I have to do the bootstrap with ada disabled.
>
> Heh - I usually do LTO bootstrap only for c,c++,fortran as otherwise it
> takes ages... ;)

Yes,it is slow, good news is lto works for java,objc,objc++,go on my machine.

Thanks,
bin
>
> Richard.
>
>> ../../gcc/gcc/ada/exp_ch3.adb: In function 'exp_ch3__get_simple_init_val':
>> ../../gcc/gcc/ada/exp_ch3.adb:7695:4: internal compiler error: in
>> forward_edge_to_pdom, at tree-ssa-dce.c:1042
>>     function Get_Simple_Init_Val
>>     ^
>> 0xc23a8d forward_edge_to_pdom
>> ../../gcc/gcc/tree-ssa-dce.c:1042
>> 0xc23c21 remove_dead_stmt
>> ../../gcc/gcc/tree-ssa-dce.c:1091
>> 0xc24120 eliminate_unnecessary_stmts
>> ../../gcc/gcc/tree-ssa-dce.c:1218
>> 0xc24b23 perform_tree_ssa_dce
>> ../../gcc/gcc/tree-ssa-dce.c:1460
>> 0xc24c1c tree_ssa_cd_dce
>> ../../gcc/gcc/tree-ssa-dce.c:1501
>> 0xc24d86 execute
>> ../../gcc/gcc/tree-ssa-dce.c:1566
>> Please submit a full bug report,
>> with preprocessed source if appropriate.
>> Please include the complete backtrace with any bug report.
>> See <http://gcc.gnu.org/bugs.html> for instructions.
>> make[4]: *** [/tmp/cc4oj0WO.ltrans1.ltrans.o] Error 1
>> lto-wrapper: fatal error: make returned 2 exit status
>> compilation terminated.
>> /usr/bin/ld: lto-wrapper failed
>> collect2: error: ld returned 1 exit status
>> make[3]: *** [gnat1] Error 1
>> make[3]: *** Waiting for unfinished jobs....
>>
>> Thanks,
>> bin
Bin.Cheng Aug. 15, 2014, 5:53 a.m. UTC | #5
On Fri, Aug 8, 2014 at 4:54 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Fri, Aug 8, 2014 at 10:05 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
>> On Thu, Aug 7, 2014 at 8:06 PM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>>> On Thu, Aug 7, 2014 at 11:46 AM, Bin Cheng <bin.cheng@arm.com> wrote:
>>>> Hi,
>>>> As analyzed in PR62032, this patch fixes the latent lto bug by switching
>>>> arguments of lto_define_builtins, otherwise vsnprintf-chk.c would fail on
>>>> arm/aarch64 with lto options.
>>>>
>>>> Is it ok if bootstrap and test pass?
>>>
>>> Ok (would be nice if you can check if LTO bootstrap still works).
>> Done.  Bootstrap with "--with-build-config=bootstrap-lto" works fine.
>> I will commit this to trunk and wait for couple of days before
>> back-port to 4_9 branch.  Is that OK?
>
> Sure.
Since the patch is on trunk for one week with no issue reported, I
backported it to gcc-4_9 branch as revision 214000.

Thanks,
bin
>
>> BTW, I found GCC trunk@213701 failed when building ada with below ICE
>> message, so I have to do the bootstrap with ada disabled.
>
> Heh - I usually do LTO bootstrap only for c,c++,fortran as otherwise it
> takes ages... ;)
>
> Richard.
>
>> ../../gcc/gcc/ada/exp_ch3.adb: In function 'exp_ch3__get_simple_init_val':
>> ../../gcc/gcc/ada/exp_ch3.adb:7695:4: internal compiler error: in
>> forward_edge_to_pdom, at tree-ssa-dce.c:1042
>>     function Get_Simple_Init_Val
>>     ^
>> 0xc23a8d forward_edge_to_pdom
>> ../../gcc/gcc/tree-ssa-dce.c:1042
>> 0xc23c21 remove_dead_stmt
>> ../../gcc/gcc/tree-ssa-dce.c:1091
>> 0xc24120 eliminate_unnecessary_stmts
>> ../../gcc/gcc/tree-ssa-dce.c:1218
>> 0xc24b23 perform_tree_ssa_dce
>> ../../gcc/gcc/tree-ssa-dce.c:1460
>> 0xc24c1c tree_ssa_cd_dce
>> ../../gcc/gcc/tree-ssa-dce.c:1501
>> 0xc24d86 execute
>> ../../gcc/gcc/tree-ssa-dce.c:1566
>> Please submit a full bug report,
>> with preprocessed source if appropriate.
>> Please include the complete backtrace with any bug report.
>> See <http://gcc.gnu.org/bugs.html> for instructions.
>> make[4]: *** [/tmp/cc4oj0WO.ltrans1.ltrans.o] Error 1
>> lto-wrapper: fatal error: make returned 2 exit status
>> compilation terminated.
>> /usr/bin/ld: lto-wrapper failed
>> collect2: error: ld returned 1 exit status
>> make[3]: *** [gnat1] Error 1
>> make[3]: *** Waiting for unfinished jobs....
>>
>> Thanks,
>> bin
diff mbox

Patch

Index: gcc/lto/lto-lang.c
===================================================================
--- gcc/lto/lto-lang.c	(revision 213698)
+++ gcc/lto/lto-lang.c	(working copy)
@@ -1192,10 +1192,10 @@  lto_init (void)
     }
   else
     {
-      lto_define_builtins (va_list_type_node,
-			   build_reference_type (va_list_type_node));
+      lto_define_builtins (build_reference_type (va_list_type_node),
+			   va_list_type_node);
     }
-  
+
   if (flag_cilkplus)
     cilk_init_builtins ();