public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60069] New: Different warning messages for -Wconversion with different optimization levels
@ 2014-02-05  0:15 chengniansun at gmail dot com
  2014-04-14 10:12 ` [Bug c/60069] " manu at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-05  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60069
           Summary: Different warning messages for -Wconversion with
                    different optimization levels
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com

For the following code, gcc with -O0 emits a conversion warning, and gcc with
-O1 emits an overflow warning. 

Does gcc have a similar policy to Clang that warnings should be not affected by
optimization levels? 


$: cat s.c
void fn1() {
  unsigned short *l_432;
  const long l_448 = 70758;
  *l_432 = +l_448;
}
$: gcc-trunk -O0 -c -Wconversion s.c
s.c: In function ‘fn1’:
s.c:4:12: warning: conversion to ‘short unsigned int’ from ‘long int’ may alter
its value [-Wconversion]
   *l_432 = +l_448;
            ^
$: gcc-trunk -O1 -c -Wconversion s.c
s.c: In function ‘fn1’:
s.c:4:12: warning: large integer implicitly truncated to unsigned type
[-Woverflow]
   *l_432 = +l_448;
            ^
$: gcc-trunk --version
gcc-trunk (GCC) 4.9.0 20140204 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>From gcc-bugs-return-442592-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 05 00:44:32 2014
Return-Path: <gcc-bugs-return-442592-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3067 invoked by alias); 5 Feb 2014 00:44:32 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3037 invoked by uid 55); 5 Feb 2014 00:44:29 -0000
From: "danglin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59777] Incorrect expansion of TLS arguments in a call
Date: Wed, 05 Feb 2014 00:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: danglin at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59777-4-eECkwNEEm9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59777-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59777-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg00349.txt.bz2
Content-length: 797

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY777

--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> ---
Author: danglin
Date: Wed Feb  5 00:43:56 2014
New Revision: 207493

URL: http://gcc.gnu.org/viewcvs?rev 7493&root=gcc&view=rev
Log:
    PR target/59777
    * config/pa/pa.c (legitimize_tls_address): Return original address
    if not passed a SYMBOL_REF rtx.
    (hppa_legitimize_address): Call legitimize_tls_address for all TLS
    addresses.
    (pa_emit_move_sequence): Simplify TLS source operands.
    (pa_legitimate_constant_p): Reject all TLS constants.
    * config/pa/pa.h (PA_SYMBOL_REF_TLS_P): Correct comment.
    (CONSTANT_ADDRESS_P): Reject TLS CONST addresses.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa.c
    trunk/gcc/config/pa/pa.h


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

* [Bug c/60069] Different warning messages for -Wconversion with different optimization levels
  2014-02-05  0:15 [Bug c/60069] New: Different warning messages for -Wconversion with different optimization levels chengniansun at gmail dot com
@ 2014-04-14 10:12 ` manu at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: manu at gcc dot gnu.org @ 2014-04-14 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-04-14
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
At least for FE warnings, yes. Optimization level should not affect the gimple
passed to the middle-end, so it should not affect -Wconversion.
>From gcc-bugs-return-448978-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Apr 14 10:12:09 2014
Return-Path: <gcc-bugs-return-448978-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24702 invoked by alias); 14 Apr 2014 10:12:09 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24167 invoked by uid 48); 14 Apr 2014 10:12:03 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60838] bugos warning: initializer element is not a constant expression: int test = (0 ? (1,0) : 0) + 1;
Date: Mon, 14 Apr 2014 10:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-60838-4-MW9HHDEuK9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60838-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60838-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg00998.txt.bz2
Content-length: 400

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`838

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-04-14
     Ever confirmed|0                           |1


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

end of thread, other threads:[~2014-04-14 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05  0:15 [Bug c/60069] New: Different warning messages for -Wconversion with different optimization levels chengniansun at gmail dot com
2014-04-14 10:12 ` [Bug c/60069] " manu 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).