public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39464] [4.3/4.4/4.5/4.6/4.7 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
@ 2011-06-27 15:20 ` rguenth at gcc dot gnu.org
  2012-03-13 15:47 ` [Bug c/39464] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-27 15:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.6                       |4.4.7

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-27 12:14:49 UTC ---
4.3 branch is being closed, moving to 4.4.7 target.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.5/4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
  2011-06-27 15:20 ` [Bug c/39464] [4.3/4.4/4.5/4.6/4.7 Regression] Attribute may_alias causes invalid warning rguenth at gcc dot gnu.org
@ 2012-03-13 15:47 ` jakub at gcc dot gnu.org
  2012-07-02 12:16 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 15:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.7                       |4.5.4

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 12:48:25 UTC ---
4.4 branch is being closed, moving to 4.5.4 target.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.5/4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
  2011-06-27 15:20 ` [Bug c/39464] [4.3/4.4/4.5/4.6/4.7 Regression] Attribute may_alias causes invalid warning rguenth at gcc dot gnu.org
  2012-03-13 15:47 ` [Bug c/39464] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
@ 2012-07-02 12:16 ` rguenth at gcc dot gnu.org
  2012-12-06 18:21 ` [Bug c/39464] [4.6/4.7/4.8 " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 12:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.4                       |4.6.4

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 12:16:14 UTC ---
The 4.5 branch is being closed, adjusting target milestone.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-07-02 12:16 ` rguenth at gcc dot gnu.org
@ 2012-12-06 18:21 ` jakub at gcc dot gnu.org
  2012-12-06 18:27 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-06 18:21 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jsm28 at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-06 18:21:09 UTC ---
In any case, I'd limit the
              /* If there is a mismatch, do warn.  */
              else if (warn_pointer_sign)
                WARN_FOR_ASSIGNMENT (location, OPT_Wpointer_sign,
                                     G_("pointer targets in passing argument "
                                        "%d of %qE differ in signedness"),
                                     G_("pointer targets in assignment "  
                                        "differ in signedness"),
                                     G_("pointer targets in initialization "
                                        "differ in signedness"),
                                     G_("pointer targets in return differ "
                                        "in signedness"));
warning to actual sign differences only, i.e.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-12-06 18:21 ` [Bug c/39464] [4.6/4.7/4.8 " jakub at gcc dot gnu.org
@ 2012-12-06 18:27 ` jakub at gcc dot gnu.org
  2012-12-06 19:29 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-06 18:27 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-06 18:27:03 UTC ---
In any case, I'd limit the
              /* If there is a mismatch, do warn.  */
              else if (warn_pointer_sign)
                WARN_FOR_ASSIGNMENT (location, OPT_Wpointer_sign,
                                     G_("pointer targets in passing argument "
                                        "%d of %qE differ in signedness"),
                                     G_("pointer targets in assignment "  
                                        "differ in signedness"),
                                     G_("pointer targets in initialization "
                                        "differ in signedness"),
                                     G_("pointer targets in return differ "
                                        "in signedness"));
warning to actual sign differences only, i.e.
              else if (warn_pointer_sign
                       && TYPE_UNSIGNED (mvl) != TYPE_UNSIGNED (mvr))
If we want to warn about other cases (I think they are generally outside of the
scope of ISO C anyway), then we should have a differently worded warning after
this one for the TYPE_UNSIGNED (mvl) == TYPE_UNSIGNED (mvr) case.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2012-12-06 18:27 ` jakub at gcc dot gnu.org
@ 2012-12-06 19:29 ` pinskia at gcc dot gnu.org
  2012-12-07 10:05 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-12-06 19:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-12-06 19:29:09 UTC ---
(In reply to comment #11)
> warning to actual sign differences only, i.e.
>               else if (warn_pointer_sign
>                        && TYPE_UNSIGNED (mvl) != TYPE_UNSIGNED (mvr))
> If we want to warn about other cases (I think they are generally outside of the
> scope of ISO C anyway), then we should have a differently worded warning after
> this one for the TYPE_UNSIGNED (mvl) == TYPE_UNSIGNED (mvr) case.

The only case which is not outside of the scope of ISO C is "char" vs "signed
char" vs "unsigned char"  They are all three distinct types and we should get a
warning about them.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-12-06 19:29 ` pinskia at gcc dot gnu.org
@ 2012-12-07 10:05 ` jakub at gcc dot gnu.org
  2012-12-07 16:42 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-07 10:05 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-07 10:04:58 UTC ---
Two of those three will always result in target_cmp != 0, because char is
either signed or unsigned, so for -fsigned-char we don't warn on
signed char *p = (char *) ptr;
char *q = (signed char *) ptr;
and similarly for -funsigned-char and s/signed/unsigned/g.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2012-12-07 10:05 ` jakub at gcc dot gnu.org
@ 2012-12-07 16:42 ` jakub at gcc dot gnu.org
  2012-12-18 22:48 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-07 16:42 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-07 16:41:36 UTC ---
Created attachment 28897
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28897
gcc48-pr39464.patch

Andrew, you were right, and a regtest with the patch I've outlined actually
showed it clearly.  For unsigned int __attribute__((may_alias)) vs. normal
unsigned int pointer we already warn about incompatible pointer type, so I'll
try the attached patch now instead.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2012-12-07 16:42 ` jakub at gcc dot gnu.org
@ 2012-12-18 22:48 ` jakub at gcc dot gnu.org
  2012-12-19  9:12 ` jakub at gcc dot gnu.org
  2012-12-20 10:40 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-18 22:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-18 22:48:09 UTC ---
Author: jakub
Date: Tue Dec 18 22:48:04 2012
New Revision: 194594

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194594
Log:
    PR c/39464
    * c-typeck.c (convert_for_assignment): For -Wpointer-sign
    warning require that both c_common_unsigned_type as well as
    c_common_signed_type is the same for both mvl and mvr types.

    * gcc.dg/pr39464.c: New test.

Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2012-12-18 22:48 ` jakub at gcc dot gnu.org
@ 2012-12-19  9:12 ` jakub at gcc dot gnu.org
  2012-12-20 10:40 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-19  9:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-19 09:12:01 UTC ---
FIxed for 4.8+, not suitable for backporting I'd say.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning
       [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2012-12-19  9:12 ` jakub at gcc dot gnu.org
@ 2012-12-20 10:40 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-20 10:40 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-20 10:40:33 UTC ---
Author: jakub
Date: Thu Dec 20 10:40:26 2012
New Revision: 194630

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194630
Log:
    PR c/39464
    * c-typeck.c (convert_for_assignment): For -Wpointer-sign
    warning require that both c_common_unsigned_type as well as
    c_common_signed_type is the same for both mvl and mvr types.

    * gcc.dg/pr39464.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr39464.c


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-20 10:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39464-4@http.gcc.gnu.org/bugzilla/>
2011-06-27 15:20 ` [Bug c/39464] [4.3/4.4/4.5/4.6/4.7 Regression] Attribute may_alias causes invalid warning rguenth at gcc dot gnu.org
2012-03-13 15:47 ` [Bug c/39464] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-07-02 12:16 ` rguenth at gcc dot gnu.org
2012-12-06 18:21 ` [Bug c/39464] [4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-12-06 18:27 ` jakub at gcc dot gnu.org
2012-12-06 19:29 ` pinskia at gcc dot gnu.org
2012-12-07 10:05 ` jakub at gcc dot gnu.org
2012-12-07 16:42 ` jakub at gcc dot gnu.org
2012-12-18 22:48 ` jakub at gcc dot gnu.org
2012-12-19  9:12 ` jakub at gcc dot gnu.org
2012-12-20 10:40 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).