Bug 50232 - [4.7 Regression] reorg.c:3971: undefined reference to `make_return_insns'
Summary: [4.7 Regression] reorg.c:3971: undefined reference to `make_return_insns'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-30 04:10 UTC by John David Anglin
Modified: 2012-03-12 17:08 UTC (History)
1 user (show)

See Also:
Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
Build: hppa-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2011-08-30 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2011-08-30 04:10:58 UTC
gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definitio
n -Wc++-compat -fno-common  -DHAVE_CONFIG_H  -o cc1plus \
              cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o cp
/pt.o cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptre
e.o cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o cp/mangl
e.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o cp/cp-gimplify.o
 tree-mudflap.o attribs.o incpath.o c-family/c-common.o c-family/c-cppbuiltin.o 
c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-f
amily/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/
c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.
o default-c.o cc1plus-checksum.o main.o tree-browser.o libbackend.a libcommon-ta
rget.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a
 ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   
 -lmpc -lmpfr -lgmp -rdynamic -ldl  -L../zlib -lz
libbackend.a(reorg.o): In function `dbr_schedule':
/home/dave/gnu/gcc/objdir/gcc/../../gcc/gcc/reorg.c:3971: undefined reference to `make_return_insns'
Comment 1 Richard Biener 2011-08-30 07:24:54 UTC
Confirmed.  Misses some #ifdef (relies on optimization otherwise).

Bernd, seems to be caused by your patch.
Comment 2 Bernd Schmidt 2011-08-30 11:31:34 UTC
Ugh, code prettyfication gone wrong. Will fix.

However, you'll probably also want to add "return" patterns to PA for optimization.
Comment 3 dave.anglin 2011-08-30 14:29:10 UTC
On 8/30/2011 7:31 AM, bernds at gcc dot gnu.org wrote:
> However, you'll probably also want to add "return" patterns to PA for
> optimization.
>
I don't think the conditions required to define a "return" pattern are 
met.  Possibly,
a "simple_return" pattern could be defined.  Is this what you are 
suggesting?

Dave
Comment 4 Bernd Schmidt 2011-08-30 15:06:05 UTC
Surely the PA has some kind of return instruction?
Most ports define a "return" pattern with an insn condition that requires that the epilogue is empty. In that case, jumps to the end of the function will be replaced by return instructions. Also, the "return" pattern can in this case emit either a "return" or a "simple_return" rtx; they are equivalent if there is no epilogue.

You can define a "simple_return" pattern, but it will only gain anything once the final shrink-wrapping bits are in.
Comment 5 dave.anglin 2011-08-31 01:10:16 UTC
On 30-Aug-11, at 11:06 AM, bernds at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50232
>
> --- Comment #4 from Bernd Schmidt <bernds at gcc dot gnu.org>  
> 2011-08-30 15:06:05 UTC ---
> Surely the PA has some kind of return instruction?
> Most ports define a "return" pattern with an insn condition that  
> requires that
> the epilogue is empty. In that case, jumps to the end of the  
> function will be
> replaced by return instructions. Also, the "return" pattern can in  
> this case
> emit either a "return" or a "simple_return" rtx; they are equivalent  
> if there
> is no epilogue.


Thanks.  I'm testing a patch.

Dave
--
John David Anglin	dave.anglin@bell.net
Comment 6 John David Anglin 2011-09-03 16:21:38 UTC
Author: danglin
Date: Sat Sep  3 16:21:27 2011
New Revision: 178500

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178500
Log:
	PR Bug middle-end/50232
	* config/pa/pa.md (return): Define "return" insn pattern.
	(epilogue): Use it when no epilogue is needed.
	* config/pa/pa.c (pa_can_use_return_insn): New function.
	* config/pa/pa-protos.h (pa_can_use_return_insn): Declare.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa-protos.h
    trunk/gcc/config/pa/pa.c
    trunk/gcc/config/pa/pa.md
Comment 7 John David Anglin 2011-09-03 16:30:42 UTC
Author: danglin
Date: Sat Sep  3 16:30:32 2011
New Revision: 178501

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178501
Log:
	PR middle-end/50232
	Correct log entry for last change.


Modified:
    trunk/gcc/ChangeLog
Comment 8 Richard Biener 2011-10-10 12:30:19 UTC
Fixed.
Comment 9 John David Anglin 2012-03-12 17:08:28 UTC
Author: danglin
Date: Mon Mar 12 17:08:20 2012
New Revision: 185252

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185252
Log:
	Backport from mainline
	2011-09-03  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR Bug middle-end/50232
	* config/pa/pa.md (return): Define "return" insn pattern.
	(epilogue): Use it when no epilogue is needed.
	* config/pa/pa.c (pa_can_use_return_insn): New function.
	* config/pa/pa-protos.h (pa_can_use_return_insn): Declare.


Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/pa/pa-protos.h
    branches/gcc-4_6-branch/gcc/config/pa/pa.c
    branches/gcc-4_6-branch/gcc/config/pa/pa.md