public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60287] New: Various issues on -Wformat=
@ 2014-02-20  9:07 chengniansun at gmail dot com
  2014-02-20 12:05 ` [Bug c/60287] " manu at gcc dot gnu.org
  2014-02-20 21:42 ` chengniansun at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-20  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60287
           Summary: Various issues on -Wformat=
           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

1) Besides "-Wformat=2", gcc accepts any option in the form of
-Wformat=<number>
   Based on the manual, gcc only accepts "-Wformat=2", and others such as
"-Wformat=0,1, 3-9" should be invalid. Any undocumented behavior?



2) Is the warning name "[-Wformat=]" in the warning message intended? 

$: gcc-trunk -Wformat=3 s.c
s.c: In function ‘main’:
s.c:4:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2
has type ‘int’ [-Wformat=]
   printf("%s%s", i, i);
   ^
s.c:4:3: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3
has type ‘int’ [-Wformat=]
$:


3) Is the column number information correct in the warning message? Should the
warning refer to the location of the problematic argument, or the function
call? Currently clang warns at the argument. 

$: clang-trunk -Wall s.c
s.c:4:18: warning: format specifies type 'char *' but the argument has type
'int' [-Wformat]
  printf("%s%s", i, i);
          ~~     ^
          %d
s.c:4:21: warning: format specifies type 'char *' but the argument has type
'int' [-Wformat]
  printf("%s%s", i, i);
            ~~      ^
            %d
2 warnings generated.
$
>From gcc-bugs-return-444314-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 09:12:09 2014
Return-Path: <gcc-bugs-return-444314-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25798 invoked by alias); 20 Feb 2014 09:12:08 -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 25751 invoked by uid 48); 20 Feb 2014 09:12:05 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57896] [4.8 Regression] ICE in expand_expr_real_2
Date: Thu, 20 Feb 2014 09:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57896-4-k5dJnxSfsl@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57896-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57896-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg02071.txt.bz2
Content-length: 2548

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

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
I have found where corruption of const_int_rtx array happens.

1. Put breakpoint on gen_rtx_CONST_INT to determine address of
const_int_rtx[24], a.k.a (const_int -40) and put HW watchpoint on its address:

Breakpoint 1, gen_rtx_CONST_INT (mode=VOIDmode, arg=0) at
../../gcc-svn/branches/gcc-4_8-branch/gcc/emit-rtl.c:400
400       if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT)
(gdb) p debug_rtx (const_int_rtx[24])
(const_int -40 [0xffffffffffffffd8])
$1 = void
(gdb) d
Delete all breakpoints? (y or n) y
(gdb) p const_int_rtx[24]
$2 = (rtx) 0x2aaaae7ba1f0
(gdb) wa *0x2aaaae7ba1f0
Hardware watchpoint 2: *0x2aaaae7ba1f0

2. Delete gen_rtx_CONST_INT breakpoint and continue.

Hardware watchpoint 2: *0x2aaaae7ba1f0

Old value = 31
New value = -1366096128
0x0000000000605de6 in gen_reg_rtx (mode=V4SImode) at
../../gcc-svn/branches/gcc-4_8-branch/gcc/emit-rtl.c:918
918       regno_reg_rtx[reg_rtx_no++] = val;
(gdb) p debug_rtx (const_int_rtx[24])
(??? bad code 1792
)
$3 = void
(gdb) bt
#0  0x0000000000605de6 in gen_reg_rtx (mode=V4SImode) at
../../gcc-svn/branches/gcc-4_8-branch/gcc/emit-rtl.c:918
#1  0x000000000098aa52 in expand_vec_perm_interleave2 (d=0x7fffffffdde0) at
../../gcc-svn/branches/gcc-4_8-branch/gcc/config/i386/i386.c:39408
#2  0x000000000098b2a0 in ix86_expand_vec_perm_const_1 (d=0x7fffffffdde0) at
../../gcc-svn/branches/gcc-4_8-branch/gcc/config/i386/i386.c:40464
#3  0x000000000098b817 in ix86_vectorize_vec_perm_const_ok (vmode=<optimized
out>, sel=<optimized out>)
    at ../../gcc-svn/branches/gcc-4_8-branch/gcc/config/i386/i386.c:40670
#4  0x000000000072ca92 in can_vec_perm_p (mode=V4SImode, variable=false,
sel=0x7fffffffde80 "\005\001\005\004")
    at ../../gcc-svn/branches/gcc-4_8-branch/gcc/optabs.c:6492
#5  0x00000000008ed744 in lower_vec_perm(struct {...} *) (gsi=0x7fffffffdf50)
    at ../../gcc-svn/branches/gcc-4_8-branch/gcc/tree-vect-generic.c:1207
#6  0x00000000008f0d09 in expand_vector_operations () at
../../gcc-svn/branches/gcc-4_8-branch/gcc/tree-vect-generic.c:1489
#7  0x000000000073fd91 in execute_one_pass (pass=0x1200440 <pass_lower_vector>)
at ../../gcc-svn/branches/gcc-4_8-branch/gcc/passes.c:2333
#8  0x00000000007402c1 in execute_pass_list (pass=0x1200440
<pass_lower_vector>) at ../../gcc-svn/branches/gcc-4_8-branch/gcc/passes.c:2381

Something goes on in expand_vec_perm_interleave2.
>From gcc-bugs-return-444315-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 09:14:19 2014
Return-Path: <gcc-bugs-return-444315-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28545 invoked by alias); 20 Feb 2014 09:14:18 -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 28493 invoked by uid 48); 20 Feb 2014 09:14:14 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57896] [4.8 Regression] ICE in expand_expr_real_2
Date: Thu, 20 Feb 2014 09:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: jakub 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: 4.8.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57896-4-iT0JJv2Lk1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57896-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57896-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/msg02072.txt.bz2
Content-length: 173

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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll have a look (unless you want to continue poking).


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

* [Bug c/60287] Various issues on -Wformat=
  2014-02-20  9:07 [Bug c/60287] New: Various issues on -Wformat= chengniansun at gmail dot com
@ 2014-02-20 12:05 ` manu at gcc dot gnu.org
  2014-02-20 21:42 ` chengniansun at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2014-02-20 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |manu at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Just adding a bit more info:

1) Like Tobias said, it is intended.
2) I agree that reproducing the exact flags that trigger the warning would be
useful, but it is a lot of work that nobody so far found time to address. It
seems also quite low priority compared to other things.

3) is PR52952, so I am closing this as a duplicate of that. I did some work,
but then I got stuck. I don't have enough free time anymore to continue it, so
if someone wishes to pick it up, please do so.

*** This bug has been marked as a duplicate of bug 52952 ***
>From gcc-bugs-return-444346-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 12:05:18 2014
Return-Path: <gcc-bugs-return-444346-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28545 invoked by alias); 20 Feb 2014 12:05:17 -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 28176 invoked by uid 48); 20 Feb 2014 12:05:12 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/52952] Wformat location info is bad (wrong column number)
Date: Thu, 20 Feb 2014 12:05: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: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu 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: cc
Message-ID: <bug-52952-4-tbN22BejnU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-52952-4@http.gcc.gnu.org/bugzilla/>
References: <bug-52952-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg02103.txt.bz2
Content-length: 488

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chengniansun at gmail dot com

--- Comment #26 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
*** Bug 60287 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-444348-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 12:07:44 2014
Return-Path: <gcc-bugs-return-444348-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 323 invoked by alias); 20 Feb 2014 12:07:44 -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 32570 invoked by uid 55); 20 Feb 2014 12:07:39 -0000
From: "ro at CeBiTec dot Uni-Bielefeld.DE" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcj/55637] FAIL: sourcelocation output - source compiled test
Date: Thu, 20 Feb 2014 12:07:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcj
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ro at CeBiTec dot Uni-Bielefeld.DE
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-55637-4-FT3bSXFHYf@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-55637-4@http.gcc.gnu.org/bugzilla/>
References: <bug-55637-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/msg02105.txt.bz2
Content-length: 595

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

--- Comment #14 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
>> What should we do about this test?  Having it fail everywhere a current
>> binutils
>> version is used causes lots of noise in testsuite results.
>
> Since nobody cared to fix the tests since more than one year, IMO the answer is
> obvious: remove it.

I've now posted a patch to xfail it instead:

http://gcc.gnu.org/ml/gcc-patches/2014-02/msg01218.html

    Rainer


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

* [Bug c/60287] Various issues on -Wformat=
  2014-02-20  9:07 [Bug c/60287] New: Various issues on -Wformat= chengniansun at gmail dot com
  2014-02-20 12:05 ` [Bug c/60287] " manu at gcc dot gnu.org
@ 2014-02-20 21:42 ` chengniansun at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-20 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Chengnian Sun <chengniansun at gmail dot com> ---
Thanks, Tobias and Manuel.


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

end of thread, other threads:[~2014-02-20 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  9:07 [Bug c/60287] New: Various issues on -Wformat= chengniansun at gmail dot com
2014-02-20 12:05 ` [Bug c/60287] " manu at gcc dot gnu.org
2014-02-20 21:42 ` chengniansun at gmail dot com

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).