[PATCH][GIMPLE FE] Add parsing of MEM_REFs
Richard Biener
rguenther@suse.de
Thu Jan 12 08:33:00 GMT 2017
On Wed, 11 Jan 2017, Joseph Myers wrote:
> On Wed, 11 Jan 2017, Richard Biener wrote:
>
> > As you can see I adjusted dumping of pointer constants (we can't
> > parse the B suffix and large unsigned numbers get a warning so
> > add 'U'). There's the general issue that we dump
> >
> > short x;
> > x = 1;
> >
> > and then lex the '1' as type int and there's no suffixes for integer
> > types smaller than int which means we can't write those constants
> > type correct :/ Suggestions welcome (currently we ICE with type
> > mismatches in those cases, we can avoid that by auto-fixing during
> > parsing but I'd like to be explicit somehow).
>
> You could always dump as ((short) 1); that's valid C.
Indeed. It makes parsing a little more awkward as (short) 1 is not
a postfix expression.
I suppose adding additional suffixes for char/short conditional on
-fgimple would be another way (either via setting user_literals option
or teaching libcpp about those itself). 's' and 'ss' (CPP_N_SMALL_SMALL
and CPP_N_SMALL_SMALL_SMALL?) would be my choice...
I'll give the (short) 1 parsing a try though to see how awkward it
really gets.
Thanks,
Richard.
More information about the Gcc-patches
mailing list