This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Yet another location_t pre-patch
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 02 Jul 2003 20:02:20 +0100
- Subject: Re: [PATCH]: Yet another location_t pre-patch
- Organization: Codesourcery LLC
- References: <OFEAAC29CD.BABA3788-ONC1256D57.00572C3E@de.ibm.com>
Ulrich Weigand wrote:
Nathan Sidwell wrote:
+ rtx
+ emit_note_copy (orig)
+ rtx orig;
+ {
[snip]
+ note = rtx_alloc (NOTE);
+
+ INSN_UID (note) = cur_insn_uid++;
+ NOTE_DATA (note) = NOTE_DATA (orig);
This breaks bootstrap on s390x-ibm-linux (and it probably wrong for other
64-bit platforms), because this always copies only a 32-bit value, even if
the actual contents of the fourth rtx field of the note occupies 64 bits
(e.g. for a character pointer in the case of a line number note).
oh. Does the attached work for you? I'm testing it now on i686.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
* rtl.h (NOTE_DATA): Refer to whole union.
* emit-rtl.c (emit_note): Use memset to clear NOTE_DATA.
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.423
diff -c -3 -p -r1.423 rtl.h
*** rtl.h 1 Jul 2003 09:17:51 -0000 1.423
--- rtl.h 2 Jul 2003 18:59:51 -0000
*************** extern const char * const reg_note_name[
*** 778,784 ****
*/
/* Opaque data. */
! #define NOTE_DATA(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
--- 778,784 ----
*/
/* Opaque data. */
! #define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 4, NOTE)
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.338
diff -c -3 -p -r1.338 emit-rtl.c
*** emit-rtl.c 1 Jul 2003 09:17:50 -0000 1.338
--- emit-rtl.c 2 Jul 2003 19:00:00 -0000
*************** emit_note (int note_no)
*** 4733,4739 ****
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
NOTE_LINE_NUMBER (note) = note_no;
! NOTE_DATA (note) = 0;
BLOCK_FOR_INSN (note) = NULL;
add_insn (note);
return note;
--- 4733,4739 ----
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
NOTE_LINE_NUMBER (note) = note_no;
! memset (&NOTE_DATA (note), 0, sizeof (NOTE_DATA (note)));
BLOCK_FOR_INSN (note) = NULL;
add_insn (note);
return note;