public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/65490] New: terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination
@ 2015-03-20 11:28 vries at gcc dot gnu.org
  2015-03-30 15:21 ` [Bug ada/65490] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2015-03-20 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65490
           Summary: terminals.c:1266:21: warning: argument to ‘sizeof’ in
                    ‘bzero’ call is the same expression as the destination
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org

warning:
...
terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same
expression as the destination; did you mean to remove the addressof?
[-Wsizeof-pointer-memaccess]
...

terminals.c:
...
static int
child_setup_tty (int fd)
{
  struct termios s;
  int    status;

  /* ensure that s is filled with 0 */
  bzero (&s, sizeof (&s));

  /* Get the current terminal settings */
  status = tcgetattr (fd, &s);
...

We should either fix bzero as the warning suggests, or remove bzero.

It not clear to me why bzero is needed before tcgetattr. Perhaps this is some
insurance against dodgy implementations of tcgetattr which do not set the full
struct s?
>From gcc-bugs-return-480949-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 20 10:55:35 2015
Return-Path: <gcc-bugs-return-480949-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27165 invoked by alias); 20 Mar 2015 10:55:34 -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 27113 invoked by uid 48); 20 Mar 2015 10:55:31 -0000
From: "david.abdurachmanov at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/65491] New: [aarch64] ICE: in emit_move_insn, at expr.c:3609
Date: Fri, 20 Mar 2015 11:34: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: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: david.abdurachmanov at gmail dot com
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-65491-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: 2015-03/txt/msg02093.txt.bz2
Content-length: 920

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide491

            Bug ID: 65491
           Summary: [aarch64] ICE: in emit_move_insn, at expr.c:3609
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david.abdurachmanov at gmail dot com

Storing a single long double in a vector will cause GCC 4.9.2 and GCC 5.0.0 to
ICE on AArch64:

typedef long double a __attribute__((vector_size (16)));

a sum(a first, a second) {
  return first + second;
}

a.c:3:3: internal compiler error: in emit_move_insn, at expr.c:3609
 a sum(a first, a second) {
   ^
Please submit a full bug report,
with preprocessed source if appropriate.

On GCC 5.0.0 (F22) it reports expr.c:3601

Any other argument for vector_size seems to work just fine. Tested up to 2048.


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

* [Bug ada/65490] terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination
  2015-03-20 11:28 [Bug ada/65490] New: terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination vries at gcc dot gnu.org
@ 2015-03-30 15:21 ` vries at gcc dot gnu.org
  2015-03-31  9:15 ` vries at gcc dot gnu.org
  2015-06-13 17:31 ` pini_os at yahoo dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2015-03-30 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #1 from vries at gcc dot gnu.org ---
https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01552.html


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

* [Bug ada/65490] terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination
  2015-03-20 11:28 [Bug ada/65490] New: terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination vries at gcc dot gnu.org
  2015-03-30 15:21 ` [Bug ada/65490] " vries at gcc dot gnu.org
@ 2015-03-31  9:15 ` vries at gcc dot gnu.org
  2015-06-13 17:31 ` pini_os at yahoo dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2015-03-31  9:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from vries at gcc dot gnu.org ---
Author: vries
Date: Tue Mar 31 08:30:15 2015
New Revision: 221789

URL: https://gcc.gnu.org/viewcvs?rev=221789&root=gcc&view=rev
Log:
Fix bzero warning in child_setup_tty

2015-03-31  Tom de Vries  <tom@codesourcery.com>

    PR ada/65490
    * terminals.c (child_setup_tty): Fix warning 'argument to sizeof in
    bzero call is the same expression as the destination'.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/terminals.c


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

* [Bug ada/65490] terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination
  2015-03-20 11:28 [Bug ada/65490] New: terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination vries at gcc dot gnu.org
  2015-03-30 15:21 ` [Bug ada/65490] " vries at gcc dot gnu.org
  2015-03-31  9:15 ` vries at gcc dot gnu.org
@ 2015-06-13 17:31 ` pini_os at yahoo dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: pini_os at yahoo dot fr @ 2015-06-13 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

Pierre-Nicolas Clauss <pini_os at yahoo dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pini_os at yahoo dot fr

--- Comment #4 from Pierre-Nicolas Clauss <pini_os at yahoo dot fr> ---
*** Bug 66529 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2015-06-13 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 11:28 [Bug ada/65490] New: terminals.c:1266:21: warning: argument to ‘sizeof’ in ‘bzero’ call is the same expression as the destination vries at gcc dot gnu.org
2015-03-30 15:21 ` [Bug ada/65490] " vries at gcc dot gnu.org
2015-03-31  9:15 ` vries at gcc dot gnu.org
2015-06-13 17:31 ` pini_os at yahoo dot fr

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