PATCH (c,c++) for c++/57793

Kyrylo Tkachov kyrylo.tkachov@arm.com
Wed Jul 17 08:53:00 GMT 2013


Hi Jason,

> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Jason Merrill
> Sent: 14 July 2013 00:00
> To: Joseph S. Myers
> Cc: Eric Botcazou; gcc-patches@gcc.gnu.org; Richard Biener
> Subject: PATCH (c,c++) for c++/57793
> 
> On 07/10/2013 01:24 AM, Eric Botcazou wrote:
> > The idea behind the existing trick is that the reference is within the
> bounds
> > of the base object, i.e. the global offset (offset<<3 + bitpos) is
> positive,
> > but the bitpos part is negative, so we rearrange it into ((offset-
> c>>3)<<3 +
> > (bitpos+c)).  Here the global offset is negative because it has
> overflowed so
> > I'm not sure the rearrangement makes any sense.
> 
> I thought the idea of the trick was that when offset<<3 is too big, we
> can use offset as a byte offset and then use bitpos separately in order
> to avoid the overflowing operation.  But I guess I was wrong; we end up
> with a negative number in the assembly output.
> 
> So here's a patch that just complains about the class being too big.
> Tested x86_64-pc-linux-gnu, applying to trunk.  Joseph, I'm assuming the
> change makes sense for C as well; let me know if you disagree.

With this patch we now get PASS->FAIL: gcc.dg/pr42611.c, because the error
message now appears on the line of the definition of the struct. This patch
fixes the testcase.
Ok to apply to trunk?

Thanks,
Kyrill

2013-07-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* gcc.dg/pr42611.c: Move dg-error to correct line.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr42611.patch
Type: application/octet-stream
Size: 599 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130717/13b2d8f3/attachment.obj>


More information about the Gcc-patches mailing list