This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bootstrap error on arm-netbsd1.4 (release branch)



Arrgh!  I thought this was working ok, but I tried a bootstrap of the 
release branch (as of this morning) and I get an ICE when building 
libchill/chillstdio.c.  I think it can be reduced to

	static void foo(void) __attribute__ ((constructor));

	static void foo(void)
	{
	  printf("Hello\n");
	}

The problem is that there is a garbage mode value getting into the return 
result when compiling the constructor stub.  From a solaris->arm-netbsd 
cross compiler the initial rtl dump reads

;; Function foo

(note 2 0 3 "" NOTE_INSN_DELETED)

(note 3 2 4 "" NOTE_INSN_FUNCTION_BEG)

(note 4 3 6 "" NOTE_INSN_DELETED)

(note 6 4 8 0 NOTE_INSN_BLOCK_BEG)

(insn 8 6 10 (set (reg:SI 32)
        (symbol_ref/v:SI ("*LC0"))) -1 (nil)
    (nil))

(insn 10 8 11 (set (reg:SI 0 r0)
        (reg:SI 32)) -1 (nil)
    (nil))

(call_insn 11 10 13 (parallel[ 
            (set (reg:SI 0 r0)
                (call (mem:SI (symbol_ref:SI ("printf")) 0)
                    (const_int 0 [0x0])))
            (clobber (reg:SI 14 lr))
        ] ) -1 (nil)
    (nil)
    (expr_list (use (reg:SI 0 r0))
        (nil)))

(note 13 11 14 0 NOTE_INSN_BLOCK_END)

(note 14 13 16 "" NOTE_INSN_FUNCTION_END)

(code_label 16 14 0 2 "" [num uses: 0])

;; Function _GLOBAL_.I.ch2.cq1OtJb

(note 2 0 3 "" NOTE_INSN_DELETED)

(note 3 2 4 "" NOTE_INSN_FUNCTION_BEG)

(note 4 3 5 "" NOTE_INSN_DELETED)

(call_insn 5 4 6 (parallel[ 
            (set (reg:CC_NOOV 0 r0)
                (call (mem:SI (symbol_ref:SI ("foo")) 0)
                    (const_int 0 [0x0])))
            (clobber (reg:SI 14 lr))
        ] ) -1 (nil)
    (nil)
    (nil))

(note 6 5 8 "" NOTE_INSN_FUNCTION_END)

(code_label 8 6 0 5 "" [num uses: 0])


Note that the return value of the call to "foo" in the constructor stub is 
CC_NOOV, which is completely bogus (on a netbsd machine itself I get a 
completly different value).

This seems to be a front-end issue, but I've no idea what is going on and 
don't want to delay reporting this while I mess around trying to 
understand the front-end code.


Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]