Patchwork Fix PR54326

login
register
mail settings
Submitter Richard Guenther
Date Aug. 20, 2012, 7:29 a.m.
Message ID <alpine.LNX.2.00.1208200928240.28649@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/178693/
State New
Headers show

Comments

Richard Guenther - Aug. 20, 2012, 7:29 a.m.
The following should fix PR54326 (3.4.6 at least compiles genoutput.c
without warnings after this).

Bootstrap running on x86_64-unknown-linux-gnu.

Richard.

2012-08-20  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/54326
	* genoutput.c (note_constraint): Properly use CONST_CAST.

Patch

Index: gcc/genoutput.c
===================================================================
--- gcc/genoutput.c	(revision 190523)
+++ gcc/genoutput.c	(working copy)
@@ -1175,7 +1175,7 @@  note_constraint (rtx exp, int lineno)
 	}
     }
   new_cdata = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen);
-  strcpy ((char *)new_cdata + offsetof(struct constraint_data, name), name);
+  strcpy (CONST_CAST(char *, new_cdata->name), name);
   new_cdata->namelen = namelen;
   new_cdata->lineno = lineno;
   new_cdata->next_this_letter = *slot;