public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60523] Warning flag for octal literals
       [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
@ 2014-03-14  8:58 ` pinskia at gcc dot gnu.org
  2014-03-14 10:39 ` david at westcontrol dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-03-14  8:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Octal literals are very useful for expressing unix/posix file modes like 0777
or even 0666.  So having the warning part of eith -Wall or -Wextra does not
make sense.


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

* [Bug c/60523] Warning flag for octal literals
       [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
  2014-03-14  8:58 ` [Bug c/60523] Warning flag for octal literals pinskia at gcc dot gnu.org
@ 2014-03-14 10:39 ` david at westcontrol dot com
  2014-03-14 10:51 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: david at westcontrol dot com @ 2014-03-14 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Brown <david at westcontrol dot com> ---
Yes, octal literals are traditionally used for posix file modes (I know of no
other common usage for them, but of course there may other uses that I haven't
heard of).  That is one of the reasons why "-Woctal" should probably not be
part of "-Wall".  But I think it is still within the scope of "-Wextra" of
warnings that are triggered by valid code, but which often indicate problems.  

However, I am not fussy about its inclusion in -Wextra - it would be convenient
for many users and let them take advantage of -Woctal without using it
explicitly, but the main enhancement request is for the -Woctal flag itself.


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

* [Bug c/60523] Warning flag for octal literals
       [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
  2014-03-14  8:58 ` [Bug c/60523] Warning flag for octal literals pinskia at gcc dot gnu.org
  2014-03-14 10:39 ` david at westcontrol dot com
@ 2014-03-14 10:51 ` manu at gcc dot gnu.org
  2014-03-14 11:31 ` david at westcontrol dot com
  2022-08-29 23:25 ` [Bug c/60523] Warning flag for octal literals [-Woctal-literals] f.heckenbach@fh-soft.de
  4 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2014-03-14 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
I would suggest that you implement this as a plugin. Plugins are particularly
useful for enforcing this type of coding standards. If you make a generally
useful plugin like one enforcing MISRA standards, it could be distributed with
GCC in order to serve as a testcase for the plugins framework.
>From gcc-bugs-return-446282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 14 11:16:58 2014
Return-Path: <gcc-bugs-return-446282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12902 invoked by alias); 14 Mar 2014 11:16:57 -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 12877 invoked by uid 48); 14 Mar 2014 11:16:51 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60525] New: [4.9 Regression]  ICE: in final_scan_insn, at final.c:2952
Date: Fri, 14 Mar 2014 11:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-60525-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-03/txt/msg01151.txt.bz2
Content-length: 2588

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

            Bug ID: 60525
           Summary: [4.9 Regression]  ICE: in final_scan_insn, at
                    final.c:2952
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

markus@x4 libgcc % cat test.i
typedef struct
{
  long w[2];
} UINT128;
extern UINT128 a[];
int b, c, f, g, h, i, l, m, o, p, q;
double d;
UINT128 j, k, t;
long n, r;
unsigned long s;
fn1 (UINT128 *p1, UINT128 p2, UINT128 p3)
{
  int e;
  if (p2.w[1])
    p1->w[0] = p3.w[0];
  e = d + p2.w[0];
  if (p3.w[1])
    c = e;
  p1->w[1] = b;
}

fn2 ()
{
  UINT128 u;
  fn1 (&t, j, k);
  u = a[l];
  int v, w;
  o = t.w[0] >> 1;
  w = u.w[1] >> 32;
  n = t.w[0] * u.w[0];
  q = r;
  r = r + s + (n >> 32);
  v = q + r >> 1;
  r = o * u.w[0];
  q = o * w;
  r = r + s + (n >> 32);
  m = q + r;
  p = u.w[1] >> 32;
  r = u.w[1];
  s = 0;
  r = r + t.w[1] + n;
  i = v;
  o = t.w[0];
  h = k.w[1] * k.w[0];
  g = j.w[1];
  f = j.w[0];
}

markus@x4 libgcc % gcc -march=amdfam10 -O2 -c test.i
test.i: In function ‘fn2’:
test.i:47:1: error: could not split insn
 }
 ^
(insn:TI 31 30 32 5 (parallel [
            (set (reg:DF 22 xmm1 [orig:142 D.1904 ] [142])
                (float:DF (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                            (const_int -16 [0xfffffffffffffff0])) [7 %sfp+-16
S8 A64])))
            (clobber (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                        (const_int -8 [0xfffffffffffffff8])) [0  S8 A64]))
        ]) test.i:16 219 {*floatdidf2_sse_with_temp}
     (nil))
test.i:47:1: internal compiler error: in final_scan_insn, at final.c:2952
0x82e4c8 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc/gcc/rtl-error.c:109
0x6a9d5a final_scan_insn(rtx_def*, _IO_FILE*, int, int, int*)
        ../../gcc/gcc/final.c:2952
0x6a9fb6 final(rtx_def*, _IO_FILE*, int)
        ../../gcc/gcc/final.c:2023
0x6aa1e5 rest_of_handle_final
        ../../gcc/gcc/final.c:4427
0x6aa1e5 execute
        ../../gcc/gcc/final.c:4502
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
{standard input}: Assembler messages:
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc
directive
>From gcc-bugs-return-446283-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 14 11:30:47 2014
Return-Path: <gcc-bugs-return-446283-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22672 invoked by alias); 14 Mar 2014 11:30:46 -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 22638 invoked by uid 48); 14 Mar 2014 11:30:43 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60525] [4.9 Regression]  ICE: in final_scan_insn, at final.c:2952
Date: Fri, 14 Mar 2014 11:30: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.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels 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: cc
Message-ID: <bug-60525-4-yGvT4NZffb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60525-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60525-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-03/txt/msg01152.txt.bz2
Content-length: 413

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Started with r208556.


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

* [Bug c/60523] Warning flag for octal literals
       [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-03-14 10:51 ` manu at gcc dot gnu.org
@ 2014-03-14 11:31 ` david at westcontrol dot com
  2022-08-29 23:25 ` [Bug c/60523] Warning flag for octal literals [-Woctal-literals] f.heckenbach@fh-soft.de
  4 siblings, 0 replies; 5+ messages in thread
From: david at westcontrol dot com @ 2014-03-14 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from David Brown <david at westcontrol dot com> ---
I agree that warnings to match something like the MISRA coding standards would
be best done as a plugin.

But I believe that in this case, warning on octal literals would be quite a
small addition to the main gcc code.  I am not familiar enough with the gcc
source code to implement it myself (like many people, I blame lack of time) - I
therefore registered this enhancement request in the hope that someone was /is/
familiar with this part of gcc would be able to make the change quickly and
easily.


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

* [Bug c/60523] Warning flag for octal literals [-Woctal-literals]
       [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-03-14 11:31 ` david at westcontrol dot com
@ 2022-08-29 23:25 ` f.heckenbach@fh-soft.de
  4 siblings, 0 replies; 5+ messages in thread
From: f.heckenbach@fh-soft.de @ 2022-08-29 23:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60523

Frank Heckenbach <f.heckenbach@fh-soft.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f.heckenbach@fh-soft.de

--- Comment #11 from Frank Heckenbach <f.heckenbach@fh-soft.de> ---
For file modes we have S_IXUSR etc., and most programs don't even need them
very often. So I think making it part of -Wextra seems reasonable these days,
but I'd welcome such a warning either way.

https://thedailywtf.com/articles/padded-mailers recently reminded me that
0-prefixed octals can cause real problems even for experienced programmers.

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

end of thread, other threads:[~2022-08-29 23:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-60523-4@http.gcc.gnu.org/bugzilla/>
2014-03-14  8:58 ` [Bug c/60523] Warning flag for octal literals pinskia at gcc dot gnu.org
2014-03-14 10:39 ` david at westcontrol dot com
2014-03-14 10:51 ` manu at gcc dot gnu.org
2014-03-14 11:31 ` david at westcontrol dot com
2022-08-29 23:25 ` [Bug c/60523] Warning flag for octal literals [-Woctal-literals] f.heckenbach@fh-soft.de

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