Bug 18551 - wrong asm output for -mcall-prologues with g++
Summary: wrong asm output for -mcall-prologues with g++
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 3.4.4
Assignee: denisc
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2004-11-18 19:32 UTC by Bernardo Innocenti
Modified: 2005-03-20 23:54 UTC (History)
3 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-02-21 10:52:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernardo Innocenti 2004-11-18 19:32:59 UTC
The backend outputs invalid assembly containing
full function signatures when compiling C++
sources with -ffunction-sections:

  ldi r30,pm_lo8(.L_bool updateEEParam(uint16_t, uint8_t*)_body)

I'm not sure this is AVR specific, but it doesn't
certainly happen on i386-linux.
Comment 1 Bernardo Innocenti 2004-11-18 20:30:49 UTC
Oops, this PR should have been about "-mcall-prologues",
not "-ffunction-sections".
Comment 2 Andrew Pinski 2004-11-18 20:40:50 UTC
You should not use:
      const char *cfun_name = current_function_name ();
Comment 3 GCC Commits 2005-03-20 21:12:29 UTC
Subject: Bug 18551

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	marekm@gcc.gnu.org	2005-03-20 21:12:09

Modified files:
	gcc            : ChangeLog 
	gcc/config/avr : avr.c 

Log message:
	PR target/18551
	* config/avr/avr.c (avr_output_function_prologue): Do not use
	current_function_name() in a label, use a local label instead.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7922&r2=2.7923
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&r1=1.131&r2=1.132

Comment 4 GCC Commits 2005-03-20 21:13:24 UTC
Subject: Bug 18551

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	marekm@gcc.gnu.org	2005-03-20 21:13:13

Modified files:
	gcc            : ChangeLog 
	gcc/config/avr : avr.c 

Log message:
	PR target/18551
	* config/avr/avr.c (avr_output_function_prologue): Do not use
	current_function_name() in a label, use a local label instead.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.69&r2=2.7592.2.70
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.129.6.1&r2=1.129.6.2

Comment 5 GCC Commits 2005-03-20 21:14:39 UTC
Subject: Bug 18551

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	marekm@gcc.gnu.org	2005-03-20 21:14:28

Modified files:
	gcc            : ChangeLog 
	gcc/config/avr : avr.c 

Log message:
	PR target/18551
	* config/avr/avr.c (avr_output_function_prologue): Do not use
	current_function_name() in a label, use a local label instead.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.823&r2=2.2326.2.824
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.108.4.5&r2=1.108.4.6

Comment 6 Andrew Pinski 2005-03-20 23:54:22 UTC
Fixed.  Please as normal send the patch to gcc-patches@.