public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
@ 2003-11-19 10:44 dhananjayd at kpitcummins dot com
  2003-11-21 11:58 ` [Bug target/13122] " dhananjayd at kpitcummins dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dhananjayd at kpitcummins dot com @ 2003-11-19 10:44 UTC (permalink / raw)
  To: gcc-bugs

Try compiling code below with

h8300-coff-gcc -fomit-frame-pointer -mh -mn bug.c

==================================================
void foo(int a, int b, int c, int d)
{
}
void bar ( char a, char b )
{
}
void main(void)
{
        char a ;
        foo(1,2,3,4);
        a = 10;
        bar(a, 1);
        printf("a=%d\n", a);
}
==================================================

h8300-hms-run a.out prints
a=244

If you see the generated assembly, variable a is accessed using -ve offset from 
SP. It should be +ve offset.

    mov.b   r2l,@(-1,er7)   ;#  a

The problem doesn't appear if line calling function foo() is commented.
I think this is related to INITIAL_ELIMINATION_OFFSET.

-Dhananjay

-- 
           Summary: h8300 - local variable gets corrupted by function call
                    when -fomit-frame-pointer is given
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dhananjayd at kpitcummins dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: h8300-unknown-hms


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
@ 2003-11-21 11:58 ` dhananjayd at kpitcummins dot com
  2003-11-22 16:47 ` kazu at cs dot umass dot edu
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dhananjayd at kpitcummins dot com @ 2003-11-21 11:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
  2003-11-21 11:58 ` [Bug target/13122] " dhananjayd at kpitcummins dot com
@ 2003-11-22 16:47 ` kazu at cs dot umass dot edu
  2003-11-22 16:53 ` kazu at cs dot umass dot edu
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-22 16:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2003-11-22 16:47 -------
Confirmed with gcc-3.4 20031121.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kazu at cs dot umass dot edu
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-22 16:47:04
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
  2003-11-21 11:58 ` [Bug target/13122] " dhananjayd at kpitcummins dot com
  2003-11-22 16:47 ` kazu at cs dot umass dot edu
@ 2003-11-22 16:53 ` kazu at cs dot umass dot edu
  2003-11-22 17:26 ` kazu at cs dot umass dot edu
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-22 16:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2003-11-22 16:53 -------
Reduced to:

void foo (int, int, int, int);

char
bar (void)
{
  char a;
  foo (0, 0, 0, 0);
  a = 10;
  return a;
}



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (2 preceding siblings ...)
  2003-11-22 16:53 ` kazu at cs dot umass dot edu
@ 2003-11-22 17:26 ` kazu at cs dot umass dot edu
  2003-11-23  2:32 ` kazu at cs dot umass dot edu
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-22 17:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2003-11-22 17:26 -------
Probably the following better describes the problem.
You get a positive (correct) offset for "a = 10;"
and a negative one for "return a;".
So I doubt the problem is related to INITIAL_ELIMINATION_OFFSET.

void foo (int, int, int, int);

short
bar (void)
{
  short a = 10;
  foo (0, 0, 0, 0);
  return a;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (3 preceding siblings ...)
  2003-11-22 17:26 ` kazu at cs dot umass dot edu
@ 2003-11-23  2:32 ` kazu at cs dot umass dot edu
  2003-11-23 22:34 ` kazu at cs dot umass dot edu
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-23  2:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2003-11-23 02:32 -------
OK.  I've got a patch and am testing it now.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |kazu at cs dot umass dot edu
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (4 preceding siblings ...)
  2003-11-23  2:32 ` kazu at cs dot umass dot edu
@ 2003-11-23 22:34 ` kazu at cs dot umass dot edu
  2003-11-24  5:34 ` dhananjayd at kpitcummins dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-23 22:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2003-11-23 22:34 -------
Fixed with

http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01894.html
http://gcc.gnu.org/ml/gcc-cvs/2003-11/msg00701.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (5 preceding siblings ...)
  2003-11-23 22:34 ` kazu at cs dot umass dot edu
@ 2003-11-24  5:34 ` dhananjayd at kpitcummins dot com
  2003-11-24 18:23 ` kazu at cs dot umass dot edu
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dhananjayd at kpitcummins dot com @ 2003-11-24  5:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhananjayd at kpitcummins dot com  2003-11-24 05:34 -------
Subject: RE:  h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given


Thanks Kazu.

This PR can be closed. 

-Dhananjay


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (6 preceding siblings ...)
  2003-11-24  5:34 ` dhananjayd at kpitcummins dot com
@ 2003-11-24 18:23 ` kazu at cs dot umass dot edu
  2003-12-15 20:24 ` cvs-commit at gcc dot gnu dot org
  2003-12-15 21:02 ` dhazeghi at yahoo dot com
  9 siblings, 0 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2003-11-24 18:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (7 preceding siblings ...)
  2003-11-24 18:23 ` kazu at cs dot umass dot edu
@ 2003-12-15 20:24 ` cvs-commit at gcc dot gnu dot org
  2003-12-15 21:02 ` dhazeghi at yahoo dot com
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-15 20:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-15 20:24 -------
Subject: Bug 13122

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	kazu@gcc.gnu.org	2003-12-15 20:24:33

Modified files:
	gcc            : ChangeLog 
	gcc/config/h8300: h8300.c h8300.h h8300.md lib1funcs.asm 

Log message:
	PR target/13122
	* config/h8300/h8300.md (pushqi1_h8300hs_normal): New.
	(pushqi1): Call gen_pushqi1_h8300hs_normal in normal mode.
	(pushhi1_h8300hs_normal): New.
	(pushhi1): Call gen_pushqi1_h8300hs_normal in normal mode.
	
	* config/h8300/h8300.h (LINK_SPEC): Support normal mode.
	* config/h8300/h8300.c (asm_file_start): Correctly output
	an architecture directive.
	* config/h8300/lib1funcs.asm: Correctly specify an
	architecture directive.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.843&r2=1.16114.2.844
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.174.2.4&r2=1.174.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.123.2.1&r2=1.123.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.123.2.6&r2=1.123.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/lib1funcs.asm.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16&r2=1.16.4.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/13122] h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given
  2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
                   ` (8 preceding siblings ...)
  2003-12-15 20:24 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-15 21:02 ` dhazeghi at yahoo dot com
  9 siblings, 0 replies; 11+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-12-15 21:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2003-12-15 21:02 -------
Fixed for 3.3.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |3.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13122


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-12-15 21:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19 10:44 [Bug c/13122] New: h8300 - local variable gets corrupted by function call when -fomit-frame-pointer is given dhananjayd at kpitcummins dot com
2003-11-21 11:58 ` [Bug target/13122] " dhananjayd at kpitcummins dot com
2003-11-22 16:47 ` kazu at cs dot umass dot edu
2003-11-22 16:53 ` kazu at cs dot umass dot edu
2003-11-22 17:26 ` kazu at cs dot umass dot edu
2003-11-23  2:32 ` kazu at cs dot umass dot edu
2003-11-23 22:34 ` kazu at cs dot umass dot edu
2003-11-24  5:34 ` dhananjayd at kpitcummins dot com
2003-11-24 18:23 ` kazu at cs dot umass dot edu
2003-12-15 20:24 ` cvs-commit at gcc dot gnu dot org
2003-12-15 21:02 ` dhazeghi at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).