http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #30 from Jan Smets jan.sm...@alcatel-lucent.com ---
Thanks!
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #29 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Mon Nov 11 07:57:11 2013
New Revision: 204663
URL: http://gcc.gnu.org/viewcvs?rev=204663root=gccview=rev
Log:
Backported from mainline
2013-11-06 Jakub
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #28 from Jan Smets jan.sm...@alcatel-lucent.com ---
Can this be backported to 4.8 please.
Thanks
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #23 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
hmm...
all examples I can see, where bitpos is negative,
or less than the representative's bitoffset with offset=NULL,
are just blandtly invalid.
The only valid example
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
Bernd Edlinger bernd.edlinger at hotmail dot de changed:
What|Removed |Added
Attachment #31145|0 |1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #25 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #24)
Created attachment 31169 [details]
Another (better) attempt at fixing this ICE.
This avoids any negative bitpos from
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #26 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
(In reply to Jakub Jelinek from comment #25)
(In reply to Bernd Edlinger from comment #24)
Created attachment 31169 [details]
Another (better) attempt at fixing this
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #27 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Wed Nov 6 07:48:50 2013
New Revision: 20
URL: http://gcc.gnu.org/viewcvs?rev=20root=gccview=rev
Log:
PR middle-end/58970
* expr.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
Jakub Jelinek jakub at gcc dot gnu.org changed:
What|Removed |Added
CC||jakub at gcc dot
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #7 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
(In reply to Jakub Jelinek from comment #6)
That doesn't look safe, negative rbitpos is not necessarily undefined
behavior.
Can't you get the same with say
struct S {
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #7)
(In reply to Jakub Jelinek from comment #6)
That doesn't look safe, negative rbitpos is not necessarily undefined
behavior.
Can't
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org ---
Created attachment 31147
-- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31147action=edit
gcc49-pr58970.patch
Untested fix.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #10 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
but this should'nt be neccessary then?
if (bitoffset *bitpos)
{
HOST_WIDE_INT adjust = bitoffset - *bitpos;
-
gcc_assert ((adjust % BITS_PER_UNIT) ==
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #11 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #10)
but this should'nt be neccessary then?
if (bitoffset *bitpos)
{
HOST_WIDE_INT adjust = bitoffset - *bitpos;
-
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #12 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
(In reply to Jakub Jelinek from comment #11)
(In reply to Bernd Edlinger from comment #10)
but this should'nt be neccessary then?
if (bitoffset *bitpos)
{
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #13 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #12)
I meant the change here is not necessary, because after the
if (*bitpos 0) {...},
*offset can no longer be NULL, and I'd leave the
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #14 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
(In reply to Jakub Jelinek from comment #13)
(In reply to Bernd Edlinger from comment #12)
I meant the change here is not necessary, because after the
if (*bitpos 0)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #15 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
(In reply to Bernd Edlinger from comment #14)
(In reply to Jakub Jelinek from comment #13)
(In reply to Bernd Edlinger from comment #12)
I meant the change here is not
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #16 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #15)
(In reply to Bernd Edlinger from comment #14)
(In reply to Jakub Jelinek from comment #13)
(In reply to Bernd Edlinger from comment
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #17 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
struct T {
unsigned char b : 8;
unsigned char s : 1;
};
struct S {
char x;
struct T t[1];
};
void function(int x, struct S *p)
{
if (x == -1)
p-t[x].s = 0;
}
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #18 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
Well, how about this version?
Does'nt it look like a much smaller change?
--- expr.c.jj2013-10-31 14:57:05.0 +0100
+++ expr.c2013-11-04 12:51:55.013931114
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #19 from Jakub Jelinek jakub at gcc dot gnu.org ---
(In reply to Bernd Edlinger from comment #18)
Well, how about this version?
Does'nt it look like a much smaller change?
--- expr.c.jj 2013-10-31 14:57:05.0 +0100
+++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
Richard Biener rguenth at gcc dot gnu.org changed:
What|Removed |Added
CC||ebotcazou at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #21 from Jakub Jelinek jakub at gcc dot gnu.org ---
If expansion has issues with that, then supposedly the
+ if (*bitpos 0)
+{
+ gcc_assert (*offset == NULL_TREE);
+ *offset = size_int (*bitpos (BITS_PER_UNIT == 8
+
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #22 from Eric Botcazou ebotcazou at gcc dot gnu.org ---
Eric declared negative bitpos to be a nono that the expander is not handling
well. Thus, Eric, please chime in here.
Well, that's a basic sanity requirement, all the routines
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
Bernd Edlinger bernd.edlinger at hotmail dot de changed:
What|Removed |Added
CC|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #5 from Jan Smets jan.sm...@alcatel-lucent.com ---
Seems to work. Thanks!
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
Marek Polacek mpolacek at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #3 from Marek Polacek mpolacek at gcc dot gnu.org ---
struct S
{
struct
{
int b:1;
} mode[1];
};
void
foo (int x, struct S *s)
{
if (x == -1)
s-mode[x].b = 0;
}
29 matches
Mail list logo