Bug 11387 - using stop without any argument
: using stop without any argument
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: fortran
: 3.4.0
: P2 critical
: 3.4.0
Assigned To: Not yet assigned to anyone
:
: wrong-code
:
:
  Show dependency treegraph
 
Reported: 2003-07-01 03:20 UTC by Andrew Pinski
Modified: 2003-08-08 04:40 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-apple-darwin6.6
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-07-05 20:18:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2003-07-01 03:20:45 UTC
Using stop with any argument cause no data to be output in the asm which
confusses the 
darwin's as:
/var/tmp//ccZrWjym.s:18:section difference relocatable subtraction expression,
"LC0" 
minus "L00000000001$pb" using a symbol at the end of section will not produce
an 
assembly time constant
/var/tmp//ccZrWjym.s:18:use a symbol with a constant value created with an
assignment 
instead of the expression, L_const_sym = LC0 - L00000000001$pb
/var/tmp//ccZrWjym.s:17:section difference relocatable subtraction expression,
"LC0" 
minus "L00000000001$pb" using a symbol at the end of section will not produce
an 
assembly time constant
/var/tmp//ccZrWjym.s:17:use a symbol with a constant value created with an
assignment 
instead of the expression, L_const_sym = LC0 - L00000000001$pb

The way to fix this would be output one byte so it would not confuse the
Darwin's as.

Note that you need download the update to the compiler package to get the new
version 
of as which has this error.
source:
        PROGRAM DUMB
        STOP
        END
Comment 1 Dara Hazeghi 2003-07-05 19:55:09 UTC
Andrew, can you post the assembly (produced from this) that Apple's newer
assembler doesn't 
like? Thanks.
Comment 2 Andrew Pinski 2003-07-05 19:59:06 UTC
.data
.const
        .align 2
LC0:				<--- no is nothing below this!!!
.text
        .align 2
        .globl _MAIN__
_MAIN__:
        mflr r2
        bcl 20,31,"L00000000001$pb"
"L00000000001$pb":
        stw r31,-4(r1)
        li r4,0
        mflr r31
        stw r2,8(r1)
        stwu r1,-80(r1)
        addis r2,r31,ha16(LC0-"L00000000001$pb")   <---errors here
        la r3,lo16(LC0-"L00000000001$pb")(r2)   <---and here
        bl L_s_stop$stub
Comment 3 Dara Hazeghi 2003-07-05 20:18:53 UTC
Confirmed then. Is this really a bug in gcc, or in the assembler? Whatever it
is, it's going to cause a 
lot of people trouble, so updating to "critical" severity.
Comment 4 Andrew Pinski 2003-07-05 20:21:22 UTC
In fact it already has, that is the reason why I reported it, someone on the
darwin-
development list found it.
Comment 5 Andrew Pinski 2003-07-27 06:41:54 UTC
Fixed by:
2003-07-26  Geoffrey Keating

        * varasm.c (output_constant_def_contents): Use
        ASM_DECLARE_CONSTANT_NAME if defined.
        * doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME.
        * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized
        objects get at least one byte to prevent assembler problems.
        (ASM_DECLARE_CONSTANT_NAME): New.