[Bug preprocessor/61891] line-map.c: file command-line left but not entered during `cabal install -p haskell-src-exts`

2014-07-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61891

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Can you find out how's gcc invoked?  Can you provide (preferably small)
preprocessed testcase?


[Bug preprocessor/61832] [4.10 Regression] r212638 breaks building ncurses

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61832

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from ktkachov at gcc dot gnu.org ---
I'm closing this as invalid.
The bug is in the ncurses build process which assumes that the preprocessor
does not introduce new lines and mangles the output with its own sed and awk
trickery which ends up stumbling on the new chanes


[Bug preprocessor/60723] Line directives with incorrect system header flag

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723

--- Comment #25 from ktkachov at gcc dot gnu.org ---
(In reply to ktkachov from comment #24)
 (In reply to Dodji Seketeli from comment #22)
  So finally the two patches that have been proposed at
  https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01063.html and
  https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01064.html have been accepted
  and committed to trunk.
  
  I'll wait before closing this bug that the stakeholders following this test
  the tree with the new patches.
 
 This breaks building ncurses.
 
 I've filed PR 61832 for this, but now trying to reduce a testcase.

Turns out that was a bug in ncurses, so disregard this


[Bug ipa/61890] [4.10 Regression] g++.dg/ipa/devirt-23.C FAILs with -O2 -fno-devirtualize-speculatively -fno-guess-branch-probability

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61890

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org
   Target Milestone|--- |4.10.0


[Bug c/57653] filename information discarded when using -imacros

2014-07-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57653

--- Comment #22 from Marek Polacek mpolacek at gcc dot gnu.org ---
Author: mpolacek
Date: Thu Jul 24 09:00:13 2014
New Revision: 212972

URL: https://gcc.gnu.org/viewcvs?rev=212972root=gccview=rev
Log:
PR c/57653
* c-opts.c (c_finish_options): If -imacros is in effect, return.

* c-c++-common/pr57653.c: New test.
* c-c++-common/pr57653.h: New file.
* c-c++-common/pr57653-2.c: New test.
* c-c++-common/pr57653-2.h: New file.

Added:
trunk/gcc/testsuite/c-c++-common/pr57653-2.c
trunk/gcc/testsuite/c-c++-common/pr57653-2.h
trunk/gcc/testsuite/c-c++-common/pr57653.c
trunk/gcc/testsuite/c-c++-common/pr57653.h
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-opts.c
trunk/gcc/testsuite/ChangeLog


[Bug lto/61802] [4.10 Regression] AArch64 execute.exp failures with LTO after r212467

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61802

--- Comment #10 from ktkachov at gcc dot gnu.org ---
(In reply to Jan Hubicka from comment #9)
 Created attachment 33177 [details]
 Proposed patch
 
 I guess the problem is that error_mark_node is special cased in varasm to
 send symbols to BSS for invalid programs. Does the following help?

Yes, this fixes the failures on arm, will try aarch64 soon


[Bug sanitizer/61771] Test failures in ASan testsuite on ARM Linux due to FP format mismatch between libasan and GCC.

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771

--- Comment #7 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to Evgeniy Stepanov from comment #3)
 Yes, FP on ARM is non-standard and differs in GCC and Clang implementations.
 Disabling fast unwind is not really an option, as you are looking at 10x,
 maybe 100x slowdown (depending of the app, of course).
 It should be possible to detect fp layout on the frame basis - there is a
 slot (don't know which one off the top of my head) that is FP in one
 compiler and return address in the other. Comparing its contents with the
 current stack limits (readily available in ASan) should do the trick.
 
 Of course, it would be awesome if we could synchronize (and document
 somewhere) FP stack layout between GCC and Clang - after all, there is no
 strong reason to do it one way or the other.

I think finding a fix in the run time will be better and probably more
resilient across versions of GCC. In any case I think this is worthy of a work
around in the sanitisers rather than in GCC itself. 

I don't know where the bugs for the sanitizer run time is tracked - so it maybe
worth closing this with a link to the appropriate upstream bug report.


[Bug c++/61892] RVO not occurs with constructor with universal reference arguments

2014-07-24 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61892

--- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org ---
(In reply to tower120 from comment #0)
 I'm not sure that this is bug. But this is strange behavior, if you ask me.

GCC's behaviour looks correct to me. If it looks strange to you it's because
you have an unconstrained constructor template, and that is usually not a good
idea.

The return statement in f returns an rvalue, so the compiler selects a
constructor that can be called with a non-const rvalue of type C.

Your class has a user-defined destructor, therefore an implicit move
constructor is not defined.

C(Args...) cannot be instantiated as CC(C) to copy or move an object, as that
would lead to infinite recursion, so when you have C(Args...) the
implicitly-defined copy constructor C(const C) is used for the return value,
and it can be elided.

When you declare C(Args...) that can be instantiated as CC(C) to
construct the return value, but as that is not a copy constructor or move
constructor it cannot be elided.

When you declare a user-defined move constructor that will be used, and can be
elided.


[Bug middle-end/52478] -ftrapv calls the wrong functions in libgcc

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52478

--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org ---
It seems that the libgcc functions for SImode are present (at least on x86_64),
so sth like

Index: gcc/optabs.c
===
--- gcc/optabs.c(revision 212970)
+++ gcc/optabs.c(working copy)
@@ -5559,13 +5559,17 @@ gen_int_libfunc (optab optable, const ch
 enum machine_mode mode)
 {
   int maxsize = 2 * BITS_PER_WORD;
+  int minsize = BITS_PER_WORD;

   if (GET_MODE_CLASS (mode) != MODE_INT)
 return;
   if (maxsize  LONG_LONG_TYPE_SIZE)
 maxsize = LONG_LONG_TYPE_SIZE;
-  if (GET_MODE_CLASS (mode) != MODE_INT
-  || GET_MODE_BITSIZE (mode)  BITS_PER_WORD
+  if (minsize  INT_TYPE_SIZE
+   (trapv_binoptab_p (optable)
+ || trapv_unoptab_p (optable)))
+minsize = INT_TYPE_SIZE;
+  if (GET_MODE_BITSIZE (mode)  minsize
   || GET_MODE_BITSIZE (mode)  maxsize)
 return;
   gen_libfunc (optable, opname, suffix, mode);
Index: gcc/expr.c
===
--- gcc/expr.c  (revision 212970)
+++ gcc/expr.c  (working copy)
@@ -9212,7 +9212,9 @@ expand_expr_real_2 (sepops ops, rtx targ
   if (modifier == EXPAND_STACK_PARM)
 target = 0;
   temp = expand_binop (mode, this_optab, op0, op1, target,
-  unsignedp, OPTAB_LIB_WIDEN);
+  unsignedp,
+  trapv_binoptab_p (this_optab)
+  ? OPTAB_LIB : OPTAB_LIB_WIDEN);
   gcc_assert (temp);
   /* Bitwise operations do not need bitfield reduction as we expect their
  operands being properly truncated.  */

makes the testcase pass.


[Bug middle-end/61893] New: Constant folding inhibits trapping with -ftrapv

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61893

Bug ID: 61893
   Summary: Constant folding inhibits trapping with -ftrapv
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

int
iaddv (void)
{
  return __INT_MAX__ + 1;
}

 ./cc1 -quiet t2.c -ftrapv
t2.c: In function 'iaddv':
t2.c:4:24: warning: integer overflow in expression [-Woverflow]
 return __INT_MAX__ + 1;
^

iaddv:
.LFB0:
.cfi_startproc
pushq   %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq%rsp, %rbp
.cfi_def_cfa_register 6
movl$-2147483648, %eax
popq%rbp
.cfi_def_cfa 7, 8
ret


[Bug c++/61892] RVO not occurs with constructor with universal reference arguments

2014-07-24 Thread tower120 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61892

--- Comment #2 from tower120 tower120 at gmail dot com ---
Well ok, but what about this?

http://coliru.stacked-crooked.com/a/e3ce8882c68dbef2

Why it copy with wrong number of argument?


[Bug sanitizer/61771] Test failures in ASan testsuite on ARM Linux due to FP format mismatch between libasan and GCC.

2014-07-24 Thread y.gribov at samsung dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771

--- Comment #8 from Yury Gribov y.gribov at samsung dot com ---
(In reply to Ramana Radhakrishnan from comment #7)
 I think finding a fix in the run time will be better and probably more
 resilient across versions of GCC. In any case I think this is worthy of a
 work around in the sanitisers rather than in GCC itself. 

Ok, we are working on a libsanitizer workaround for this.

 I don't know where the bugs for the sanitizer run time is tracked - so it
 maybe worth closing this with a link to the appropriate upstream bug report.

AFAIK we keep bugs open until they get fixed with next merge from LLVM.(In
reply to Ramana Radhakrishnan from comment #7)


[Bug lto/61802] [4.10 Regression] AArch64 execute.exp failures with LTO after r212467

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61802

--- Comment #11 from ktkachov at gcc dot gnu.org ---
(In reply to ktkachov from comment #10)
 (In reply to Jan Hubicka from comment #9)
  Created attachment 33177 [details]
  Proposed patch
  
  I guess the problem is that error_mark_node is special cased in varasm to
  send symbols to BSS for invalid programs. Does the following help?
 
 Yes, this fixes the failures on arm, will try aarch64 soon

AArch64 seems to work fine too with this patch.


[Bug middle-end/61894] New: Fail to fold read from constant vector initializer

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61894

Bug ID: 61894
   Summary: Fail to fold read from constant vector initializer
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

The following is not handled by fold_const_aggregate_ref and siblings.


/* { dg-do run } */
/* { dg-options -O } */

extern void abort (void);

/* We should fold all reads from xconstant and eliminate it, removing
   the reference to blah which cannot be resolved at link time.  */
extern int blah;

typedef int v4si __attribute__((vector_size(16)));

static const struct {
int *y;
const v4si x[2] __attribute__((aligned(32)));
} xconstant = { blah, { { 0, 1, 2, 3 }, { 2, 3, 4, 5 } } };

int main()
{
  if (sizeof (int) != 4)
return 0;
  if (*(int *)xconstant.x[0][0] != 0)
abort ();
  if (*(int *)xconstant.x[0][1] != 1)
  if (*(int *)xconstant.x[0][2] != 2)
abort ();
  if (*(int *)xconstant.x[0][3] != 3)
abort ();
  if (*(int *)xconstant.x[1][0] != 2)
abort ();
  if (*(int *)xconstant.x[1][1] != 3)
abort ();
  if (*(int *)xconstant.x[1][2] != 4)
abort ();
  if (*(int *)xconstant.x[1][3] != 5)
abort ();
  return 0;
}


[Bug middle-end/61894] Fail to fold read from constant vector initializer

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61894

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-07-24
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org ---
Mine.


[Bug middle-end/61894] Fail to fold read from constant vector initializer

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61894

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
Because fold_ctor_reference doesn't handle VECTOR_CST.


[Bug other/61895] New: libbacktrace crashes with bus error with empty file argv[0]

2014-07-24 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61895

Bug ID: 61895
   Summary: libbacktrace crashes with bus error with empty file
argv[0]
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vogt at linux dot vnet.ibm.com

Docker uses a call of the exec family to start a new process with a bogus
argv[0] argument, i.e. argv[0] points to an empty file, not a real executable. 
libbacktrace opens the empty file, mmaps it and uses it without ever checking
the size of the file.  Eventually, libbacktrace causes a bus error (on s390x,
may be a different fault on other architectures) in elf.c:564:

  memcpy (ehdr, ehdr_view.data, sizeof ehdr);

-

The problem can be reproduced like this (it's probably possible to reproduce
this with a C program):

-- BEGIN exec.c --
#include unistd.h

int main(int argc, char *argv[])
{
execv(argv[0], argv[1]);
return 1;   
}
-- END exec.c --

-- BEGIN hello.go --
package main
import fmt

func main() {
fmt.Println(Hello!)
}
-- END hello.go --

$ gcc -o exec exec.c
$ gccgo -g -o hello hello.go
$ touch empty
$ ./exec ./hello $PWD/empty
Bus error (core dumped)

-

Fix: libbacktrace needs to sanitize its input, i.e. the files it tries to open
in fileline_initialize().  Such a file must be at least as long as sizeof ehdr,
but there may be more places in the code that don't do size checking.  The
right approach might be something like this:

  descriptor = backtrace_open(...)
  if (descriptor = 0)
{
  if (!is_executable_valid(descriptor))
{
  /* close descriptor */
  /* maybe emit an error message */
  /* try other files */
}
}

  int is_executable_valid(int descriptor)
  {
...
  }


[Bug lto/61802] [4.10 Regression] AArch64 execute.exp failures with LTO after r212467

2014-07-24 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61802

--- Comment #12 from Jan Hubicka hubicka at ucw dot cz ---
  Yes, this fixes the failures on arm, will try aarch64 soon
 
 AArch64 seems to work fine too with this patch.
Thanks! I will double check it and commit then.

Honza


[Bug ipa/61890] [4.10 Regression] g++.dg/ipa/devirt-23.C FAILs with -O2 -fno-devirtualize-speculatively -fno-guess-branch-probability

2014-07-24 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61890

Jan Hubicka hubicka at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-07-24
   Assignee|unassigned at gcc dot gnu.org  |hubicka at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jan Hubicka hubicka at gcc dot gnu.org ---
mine.


[Bug other/61896] New: Wrong documentation for -finput-charset

2014-07-24 Thread yavor at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61896

Bug ID: 61896
   Summary: Wrong documentation for -finput-charset
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yavor at gnu dot org

Created attachment 33179
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33179action=edit
Patch to correct the documention about the -finput-charset option

The documentation for -finput-charset doesn't reflect reality and that has been
so for quite some time.  The attached trivial patch addresses this.


[Bug target/58623] lack of ldp/stp optimization

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58623

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Target|AArch64 |aarch64-*
 Status|NEW |ASSIGNED
 CC||ramana at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |amker at gcc dot gnu.org

--- Comment #2 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
Bin Cheng has been working on this specifically around putting out a new pass
to deal with this.


[Bug other/61896] Wrong documentation for -finput-charset

2014-07-24 Thread yavor at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61896

Yavor Doganov yavor at gnu dot org changed:

   What|Removed |Added

 CC||yavor at gnu dot org
   Severity|normal  |trivial


[Bug target/55701] Inline some instances of memset for ARM

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55701

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #5 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
Changing state to assigned.


[Bug ipa/61823] [4.10 Regression] gcc.dg/torture/pr43879_[12].c FAILs with -fno-inline

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61823

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Thu Jul 24 12:01:31 2014
New Revision: 212980

URL: https://gcc.gnu.org/viewcvs?rev=212980root=gccview=rev
Log:
2014-07-24  Richard Biener  rguent...@suse.de

PR ipa/61823
* tree-ssa-structalias.c (create_variable_info_for_1):
Use varpool_get_constructor.
(create_variable_info_for): Likewise.

* gcc.dg/torture/pr43879_1.c: Add -fno-inline.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/torture/pr43879_1.c
trunk/gcc/tree-ssa-structalias.c


[Bug ipa/61823] [4.10 Regression] gcc.dg/torture/pr43879_[12].c FAILs with -fno-inline

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61823

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Fixed.


[Bug sanitizer/61771] Test failures in ASan testsuite on ARM Linux due to FP format mismatch between libasan and GCC.

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-07-24
 Ever confirmed|0   |1

--- Comment #9 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to Yury Gribov from comment #8)
 (In reply to Ramana Radhakrishnan from comment #7)
  I think finding a fix in the run time will be better and probably more
  resilient across versions of GCC. In any case I think this is worthy of a
  work around in the sanitisers rather than in GCC itself. 
 
 Ok, we are working on a libsanitizer workaround for this.
 
  I don't know where the bugs for the sanitizer run time is tracked - so it
  maybe worth closing this with a link to the appropriate upstream bug report.
 
 AFAIK we keep bugs open until they get fixed with next merge from LLVM.(In
 reply to Ramana Radhakrishnan from comment #7)

That's ok - I didn't know how you handled issues for the sanitizers when you
were working across the 2 projects.

Anyway - confirmed.


[Bug bootstrap/61320] [4.10 regression] ICE in jcf-parse.c:1622 (parse_class_file

2014-07-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #57 from Richard Biener rguenth at gcc dot gnu.org ---
Waiting for preprocessed source and configure instructions.


[Bug target/61622] [4.8 regression] internal compiler error: in simplify_const_unary_operation, at simplify-rtx.c:1508

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61622

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||4.7.0, 4.7.1, 4.7.2, 4.7.3,
   ||4.7.4, 4.9.0, 4.9.1
   Keywords||ice-on-valid-code
   Last reconfirmed||2014-07-24
 CC||ramana at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|internal compiler error: in |[4.8 regression] internal
   |simplify_const_unary_operat |compiler error: in
   |ion, at simplify-rtx.c:1508 |simplify_const_unary_operat
   ||ion, at simplify-rtx.c:1508
  Known to fail||4.8.0, 4.8.1, 4.8.2, 4.8.3

--- Comment #7 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
Filling out some details - needs a backport of that patch to the 4.8 branch.


[Bug ipa/61160] [4.9/4.10 Regression] wrong code with -O3 (or ICE: verify_cgraph_node failed: edge points to wrong declaration)

2014-07-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61160

--- Comment #15 from Martin Jambor jamborm at gcc dot gnu.org ---
Author: jamborm
Date: Thu Jul 24 13:03:22 2014
New Revision: 212987

URL: https://gcc.gnu.org/viewcvs?rev=212987root=gccview=rev
Log:
2014-07-24  Martin Jambor  mjam...@suse.cz

PR ipa/61160
* g++.dg/ipa/pr61160-2.C (main): Always return zero.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/ipa/pr61160-2.C


[Bug ipa/61160] [4.9/4.10 Regression] wrong code with -O3 (or ICE: verify_cgraph_node failed: edge points to wrong declaration)

2014-07-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61160

--- Comment #16 from Martin Jambor jamborm at gcc dot gnu.org ---
Author: jamborm
Date: Thu Jul 24 13:20:33 2014
New Revision: 212988

URL: https://gcc.gnu.org/viewcvs?rev=212988root=gccview=rev
Log:
2014-07-24  Martin Jambor  mjam...@suse.cz

PR ipa/61160
* g++.dg/ipa/pr61160-2.C (main): Return zero.
* g++.dg/ipa/pr61160-3.C (main): Likewise.


Modified:
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ipa/pr61160-1.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ipa/pr61160-2.C


[Bug middle-end/61876] Converting __builtin_round + cast into __builtin_lround is not always equivalent in regards to math errno

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61876

--- Comment #4 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Thu Jul 24 13:23:05 2014
New Revision: 212989

URL: https://gcc.gnu.org/viewcvs?rev=212989root=gccview=rev
Log:
PR 61876: Do not convert cast + __builtin_round into __builtin_lround unless
-fno-math-errno is used.

PR middle-end/61876
* convert.c (convert_to_integer): Do not convert BUILT_IN_ROUND and cast
when flag_errno_math is on.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/convert.c


[Bug middle-end/61876] Converting __builtin_round + cast into __builtin_lround is not always equivalent in regards to math errno

2014-07-24 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61876

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #5 from ktkachov at gcc dot gnu.org ---
I think something similar should be done for the lrint case.
rint is defined everywhere whereas lrint can throw domain errors on NaN, Inf


[Bug target/61407] Build errors on latest OS X 10.10 Yosemite with Xcode 6 on GCC 4.8.3

2014-07-24 Thread jrtc27 at jrtc27 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407

--- Comment #16 from James Clarke jrtc27 at jrtc27 dot com ---
Created attachment 33180
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33180action=edit
Patch For GCC 4.9.1 On Yosemite

Requires DP 4 (or above), as I have also removed the fix for Availability.h
which was only needed in DP 3 and below.


[Bug lto/61802] [4.10 Regression] AArch64 execute.exp failures with LTO after r212467

2014-07-24 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61802

--- Comment #13 from Jan Hubicka hubicka at gcc dot gnu.org ---
Author: hubicka
Date: Thu Jul 24 13:50:31 2014
New Revision: 212991

URL: https://gcc.gnu.org/viewcvs?rev=212991root=gccview=rev
Log:
PR lto/61802
* varasm.c (bss_initializer_p): Handle offlined ctors.
(align_variable, get_variable_align): Likewise.
(make_decl_one_only): Likewise.
(default_binds_local_p_1): Likewise.
(decl_binds_to_current_def_p): Likewise.
(get_variable_section): Get constructor if it is offlined.
(assemble_variable_contents): Sanity check that the caller
streamed in the ctor in LTO.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/varasm.c


[Bug c++/55606] sorry, unimplemented: non-trivial designated initializers not supported

2014-07-24 Thread nightstrike at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606

nightstrike nightstrike at gmail dot com changed:

   What|Removed |Added

 CC||nightstrike at gmail dot com

--- Comment #8 from nightstrike nightstrike at gmail dot com ---
This is being proposed for C++14:

https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/IgDFqKjKlRs

http://htmlpreview.github.io/?https://raw.github.com/CTMacUser/multiarray-iso-proposal/master/designation-proposal.html


[Bug c/61779] gcc -Og fails with impossible constraint on legal C code

2014-07-24 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61779

--- Comment #10 from Vittorio Zecca zeccav at gmail dot com ---
I just installed gcc-4.9.1 and it still has this bug.
It does not even compile itself (divtf3.c) with -Og.


[Bug bootstrap/61320] [4.10 regression] ICE in jcf-parse.c:1622 (parse_class_file

2014-07-24 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

--- Comment #58 from Rainer Orth ro at gcc dot gnu.org ---
Created attachment 33181
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33181action=edit
preprocessed input


[Bug bootstrap/61320] [4.10 regression] ICE in jcf-parse.c:1622 (parse_class_file

2014-07-24 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

--- Comment #59 from Rainer Orth ro at gcc dot gnu.org ---
Configure binutils with

configure \
--target sparc-solaris2.11

and gcc with

configure \
--prefix=/var/gcc/cross/sparc-solaris2.11 \
--target sparc-solaris2.11 \
--with-gmp=/vol/gcc \
--with-gnu-as \
--disable-multilib \
--enable-languages=c++

Then compile jcf-parse.ii with

cc1plus -fpreprocessed jcf-parse.ii -quiet -mcpu=v9 -g -O2 -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -fno-common -o jcf-parse.s

  Rainer


[Bug target/61578] Code size increase for ARM thumb compared to 4.8.x when compiling with -Os

2014-07-24 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61578

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ramana at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org

--- Comment #6 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
We need preprocessed source for someone to actually try this. CC'ing Vlad as
LRA maintainer / author.


[Bug target/58622] With -fomit-frame-pointer, A64 does not generate post-decrement stores

2014-07-24 Thread mshawcroft at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58622

mshawcroft at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from mshawcroft at gcc dot gnu.org ---
Issue resolved with Jiong's prologue / epilogue patch series committed to
trunk:

The relevant optimization commits are r212976, r212999, r213000.


[Bug target/58622] With -fomit-frame-pointer, A64 does not generate post-decrement stores

2014-07-24 Thread mshawcroft at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58622

mshawcroft at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.10.0


[Bug middle-end/61654] [4.9/4.10 Regression] ICE in release_function_body, at cgraph.c:1699

2014-07-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61654

Martin Jambor jamborm at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jamborm at gcc dot 
gnu.org

--- Comment #11 from Martin Jambor jamborm at gcc dot gnu.org ---
ipa_propagate_frequency is seeing an artificial_thunk.  Mine.


[Bug middle-end/61268] [4.10 regression] ICE in vt_expand_var_loc_chain, at var-tracking.c:8262

2014-07-24 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61268

--- Comment #10 from rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org 
---
Author: rsandifo
Date: Thu Jul 24 15:17:35 2014
New Revision: 213002

URL: https://gcc.gnu.org/viewcvs?rev=213002root=gccview=rev
Log:
gcc/
PR middle-end/61268
* function.c (assign_parm_setup_reg): Prevent invalid sharing of
DECL_INCOMING_RTL and entry_parm.
(get_arg_pointer_save_area): Likewise arg_pointer_save_area.
* calls.c (load_register_parameters): Likewise argument values.
(emit_library_call_value_1, store_one_arg): Likewise argument
save areas.
* config/i386/i386.c (assign_386_stack_local): Likewise the local
stack slot.
* explow.c (validize_mem): Modify the argument in-place.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/config/i386/i386.c
trunk/gcc/explow.c
trunk/gcc/function.c


[Bug rtl-optimization/61629] [4.10 regression] FAIL: gcc.dg/20020312-2.c (internal compiler error)

2014-07-24 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61629

--- Comment #3 from rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org 
---
Author: rsandifo
Date: Thu Jul 24 15:17:54 2014
New Revision: 213003

URL: https://gcc.gnu.org/viewcvs?rev=213003root=gccview=rev
Log:
gcc/
PR rtl-optimization/61629
* reginfo.c (reinit_regs): Only call ira_init and recog_init if
they have already been initialized.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/reginfo.c


[Bug target/61407] Build errors on latest OS X 10.10 Yosemite with Xcode 6 on GCC 4.8.3

2014-07-24 Thread alexandermbock at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407

Alexander Bock alexandermbock at gmail dot com changed:

   What|Removed |Added

 CC||alexandermbock at gmail dot com

--- Comment #17 from Alexander Bock alexandermbock at gmail dot com ---
(In reply to James Clarke from comment #16)
 Created attachment 33180 [details]
 Patch For GCC 4.9.1 On Yosemite
 
 Requires DP 4 (or above), as I have also removed the fix for Availability.h
 which was only needed in DP 3 and below.

Worked great for me on DP4, thanks!


[Bug rtl-optimization/61629] [4.10 regression] FAIL: gcc.dg/20020312-2.c (internal compiler error)

2014-07-24 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61629

rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org 
---
Patch applied.


[Bug middle-end/61268] [4.10 regression] ICE in vt_expand_var_loc_chain, at var-tracking.c:8262

2014-07-24 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61268

rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org 
---
Patch applied.


[Bug ipa/61842] [4.10 Regression]: Firefox start-up SEGFAULT with LTO and O3

2014-07-24 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61842

--- Comment #2 from Martin Liška mliska at suse dot cz ---
Issue is not related to GCC, same error can be seen without LTO and even with
older GCC. When I tried older Firefox (May 2014), latest GCC looks fine.

[Bug ipa/61842] [4.10 Regression]: Firefox start-up SEGFAULT with LTO and O3

2014-07-24 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61842

Martin Liška mliska at suse dot cz changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Martin Liška mliska at suse dot cz ---
Invalid.

[Bug c/61897] New: sanitizer internal compiler error: in build2_stat, at tree.c:4160

2014-07-24 Thread trt at alumni dot duke.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61897

Bug ID: 61897
   Summary: sanitizer internal compiler error: in build2_stat, at
tree.c:4160
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trt at alumni dot duke.edu

gcc -c foo.c -fsanitize=address
foo.c: In function âisfooâ:
foo.c:3:5: internal compiler error: in build2_stat, at tree.c:4160

foo.c is

//#include string.h
int isfoo(char *s) { return memcmp(s, foo, 3) == 0; }

gcc -v reports:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/c/bb04na1a/vol/sas3rd/wky/mva-v940/lax/gcc/gcc-4.9.1/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/sas3rd/wky/mva-v940/lax/gcc/gcc-4.9.1
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.1 (GCC)

[Bug sanitizer/61897] sanitizer internal compiler error: in build2_stat, at tree.c:4160

2014-07-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61897

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-07-24
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Confirmed.


[Bug go/59432] [4.9/4.10 regression] sync/atomic FAILs on 32bit x86 systems without .cfi directives

2014-07-24 Thread LpSolit at netscape dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59432

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Target|i386-pc-solaris2.*  |x86
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-07-18
   Host|i386-pc-solaris2.*  |
Summary|[4.9/4.10 regression]   |[4.9/4.10 regression]
   |sync/atomic FAILs on|sync/atomic FAILs on 32bit
   |Solaris/x86 |x86 systems without .cfi
   ||directives
 Ever confirmed|0   |1
  Build|i386-pc-solaris2.*  |

--- Comment #10 from Uroš Bizjak ubizjak at gmail dot com ---
*** Bug 61840 has been marked as a duplicate of this bug. ***

--- Comment #11 from Uroš Bizjak ubizjak at gmail dot com ---
Confirmed also on CentOS 5 (a system without .cfi directives).

[Bug target/61794] internal error: unrecognizable insn, from avx512 extract instruction

2014-07-24 Thread LpSolit at netscape dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61794

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|4.10.0  |4.9.2

--- Comment #5 from Uroš Bizjak ubizjak at gmail dot com ---
Fixed for 4.9.2+.

[Bug go/61840] [4.9 regression] sync/atomic FAILs on x86_64-unknown-linux-gnu

2014-07-24 Thread LpSolit at netscape dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61840

Uroš Bizjak ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #5 from Uroš Bizjak ubizjak at gmail dot com ---
So, a duplicate after all.

*** This bug has been marked as a duplicate of bug 59432 ***

[Bug libgcc/61845] New: Minor build warnings for gcc-4.9.1

2014-07-24 Thread LpSolit at netscape dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61845

Bug ID: 61845
   Summary: Minor build warnings for gcc-4.9.1
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bdubbs at linuxfromscratch dot org

I would think that gcc would build itself cleanly.  The following warnings are
produced when building:

libgcc/config/libbid/bid64_div.c:523:51: warning: variable 'Ql' set but not
used
libgcc/config/libbid/bid64_div.c:937:51: warning: variable 'Ql' set but not
used
libgcc/config/libbid/bid64_div.c:1374:51: warning: variable 'Ql' set but not
used

libgcc/config/libbid/bid128_div.c:39:51: warning: variable 'Ql' set but not
used
libgcc/config/libbid/bid128_div.c:490:51: warning: variable 'Ql' set but not
used
libgcc/config/libbid/bid128_div.c:949:51: warning: variable 'Ql' set but not
used
libgcc/config/libbid/bid128_div.c:1406:51: warning: variable 'Ql' set but not
used

libsanitizer/ubsan/ubsan_diag.h:192:72: warning:
'Loc.__ubsan::Location::MemoryLoc' may be used uninitialized in this function
[-Wmaybe-uninitialized]

libssp/gets-chk.c:62:5: warning: 'gets' is deprecated 
libssp/gets-chk.c:69:5: warning: 'gets' is deprecated   
libssp/gets-chk.c:69: warning: the `gets' function is dangerous and should not
be used.

Built with:

mkdir ../gcc-build
cd../gcc-build
\
../gcc-4.9.1/configure   \
 --prefix=/usr   \
 --enable-shared \
 --enable-threads=posix  \
 --enable-__cxa_atexit   \
 --enable-clocale=gnu\
 --enable-languages=c,c++\
 --disable-multilib  \
 --disable-bootstrap \
 --with-system-zlib

make


[Bug libgcc/61845] Minor build warnings for gcc-4.9.1

2014-07-24 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61845

--- Comment #1 from H.J. Lu hjl.tools at gmail dot com ---
It has been fixed by r211424 on trunk.


[Bug target/54272] [SH] Add support for addv / subv instructions

2014-07-24 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54272

--- Comment #7 from Oleg Endo olegendo at gcc dot gnu.org ---
(In reply to Oleg Endo from comment #0)
 The addv and subv instructions can be used for at least two things:
 
 1) Implementing trapping signed integer arithmetic (-ftrapv)
 
Currently, for the SH target, trapping insns (e.g. addvsi3) are
supposed to be implemented by library functions in libgcc.
However, it seems that for addvsi3 and subvsi3 normal addsi3 and
subsi3 patterns are expanded by the middle-end, which is wrong.

See also PR 52478.


[Bug c++/56643] Failure to match noexcept specifier of friend template function in template class

2014-07-24 Thread Casey at Carter dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56643

--- Comment #2 from Casey Carter Casey at Carter dot net ---
For future readers, I believe the simplest workaround is to make the friend
function a static member function of a new class, friend that class instead of
the function, and introduce a simple forwarding function in the original
function's place:

template int N
struct Test {
friend struct workaround_56643;
};

struct workaround_56643 {
template int N
static void test(TestN) noexcept(N == 0) {}
};

template int N
auto test(TestN arg)
  noexcept(noexcept(workaround_56643::test(arg)))
- decltype(workaround_56643::test(arg)) {
 return workaround_56643::test(arg);
}

int main() {
Test0 t;
test(t);
}


[Bug c++/61892] RVO not occurs with constructor with universal reference arguments

2014-07-24 Thread tower120 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61892

--- Comment #3 from tower120 tower120 at gmail dot com ---
But wait, we talk about move constructor. But this is a template class.
Template class can not have move constructor at all.


[Bug middle-end/61876] Converting __builtin_round + cast into __builtin_lround is not always equivalent in regards to math errno

2014-07-24 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61876

--- Comment #6 from joseph at codesourcery dot com joseph at codesourcery dot 
com ---
On Tue, 22 Jul 2014, ktkachov at gcc dot gnu.org wrote:

 From what I understand lround can potentially set errno on a domain error
 whereas round is valid everywhere and the cast to long int could be undefined
 behaviour if the double is not valid, but undefined behaviour is not the same
 as setting errno...

Under Annex F the cast isn't undefined behavior but raising the invalid 
exception and returning an unspecified value (which must be a valid value 
of type long, i.e. the program must behave as if each execution of the 
cast in the abstract machine has some particular value of type long it 
returns).


[Bug c++/61892] RVO not occurs with constructor with universal reference arguments

2014-07-24 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61892

TC rs2740 at gmail dot com changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #4 from TC rs2740 at gmail dot com ---
There's a difference between constructors of template classes and constructors
that are themselves templates. Template classes can have copy and move
constructors (they'd better or std::vector would be useless), but constructors
that are themselves templates are neither copy constructors nor move
constructors, whether or not they belong to a template class or a non-template
class.


[Bug c/61898] New: Variadic functions accept va_list without warning

2014-07-24 Thread jzwinck at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61898

Bug ID: 61898
   Summary: Variadic functions accept va_list without warning
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jzwinck at gmail dot com

This is a type of error I've seen multiple times in production code.  It
typically arises when forwarding variadic arguments to another function, like
so:



#include stdarg.h
#include stdio.h

void printfBadly(const char* fmt, ...)
{
  va_list ap;
  va_start(ap, fmt);
  printf(fmt, ap); // oops, we wanted vprintf
  va_end(ap);
}



GCC 4.9.0 (and 4.7.2) with -Wall -Wextra compiles this program with no
complaint, but it produces undefined behavior.  There are two types of errors
which GCC could check for:

(1) GCC knows how to check printf when the format string is a literal, but
otherwise doesn't seem to check the arguments at all.  Passing a va_list to
printf (or any function with attribute(format(printf))) is almost certainly an
error.  The only conversion specifier that seems usable with a va_list is %p,
and even that is non-portable, unlikely to be useful, and probably not what the
programmer intended.  Related to this, there is also no warning when passing a
struct (by value) to printf, though such code is likely incorrect.

(2) Passing a va_list via variadic arguments is almost never correct.  The
example above used printf when it needed vprintf, but this is a more general
point: a va_list passed anywhere within ellipsis varags is very likely to be a
mistake which results in undefined behavior.  This type of error applies not
only to printf-like functions, but to variadic functions in general.

In either case, a warning would be very useful (with -Wextra at least).


[Bug c/61899] New: gcc/Makefile.in: compile failure occasionally while parallel make enabled

2014-07-24 Thread hongxu.jia at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899

Bug ID: 61899
   Summary: gcc/Makefile.in: compile failure occasionally while
parallel make enabled
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hongxu.jia at windriver dot com

Created attachment 33182
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33182action=edit
compile failure log

Reproduce steps

1. Manually modify gcc/Makefile.in to delay the
generation of config.h:
...
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c4daf69..c502898 100644
--- gcc-4.9.0/gcc/Makefile.in
+++ gcc-4.9.0/gcc/Makefile.in
@@ -1622,9 +1622,12 @@ tm.h: cs-tm.h ; @true
 tm_p.h: cs-tm_p.h ; @true

 cs-config.h: Makefile
+   @echo start to generate config.h `date`
+   sleep 10
TARGET_CPU_DEFAULT= \
HEADERS=$(host_xm_include_list) DEFINES=$(host_xm_defines) \
$(SHELL) $(srcdir)/mkconfig.sh config.h
+   @echo config.h generated `date`

 cs-bconfig.h: Makefile
TARGET_CPU_DEFAULT= \
...

2. configure and compile gcc failure
...
../../gcc-4.10-20140720/gcc/hwint.h:237:8: error: ‘HOST_WIDE_INT’ does not name
a type 
../../gcc-4.10-20140720/gcc/hwint.h:241:15: error: ‘HOST_WIDE_INT’ does not
name a type 
../../gcc-4.10-20140720/gcc/hwint.h:256:1: error: expected initializer before
‘zext_hwi’
make[3]: *** [errors.o] Error 1
...
../../gcc-4.10-20140720/gcc/hwint.h:237:8: error: ‘HOST_WIDE_INT’ does not name
a type
../../gcc-4.10-20140720/gcc/hwint.h:241:15: error: ‘HOST_WIDE_INT’ does not
name a type
../../gcc-4.10-20140720/gcc/hwint.h:256:1: error: expected initializer before
‘zext_hwi’
make[3]: *** [gcc-ar.o] Error 1
...

[Bug c/61899] gcc/Makefile.in: compile failure occasionally while parallel make enabled

2014-07-24 Thread hongxu.jia at windriver dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899

--- Comment #1 from hongxu jia hongxu.jia at windriver dot com ---
Here is my solution:

gcc/Makefile.in: add missing errors.o/gcc-ar.o/gcc-nm.o/gcc-ranlib.o to OBJS

While parallel make, the '$(ALL_HOST_OBJS) : | $(generated_files)' rule
doesn't work for these missing objects. And there was potential compile
failure.

Signed-off-by: Hongxu Jia hongxu@windriver.com
---
 gcc/Makefile.in | 4 
 1 file changed, 4 insertions(+)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a726109..e753ebd 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1224,6 +1224,7 @@ OBJS = \
dwarf2out.o \
emit-rtl.o \
et-forest.o \
+   errors.o \
except.o \
explow.o \
expmed.o \
@@ -1233,6 +1234,9 @@ OBJS = \
fold-const.o \
function.o \
fwprop.o \
+   gcc-ar.o \
+   gcc-nm.o \
+   gcc-ranlib.o \
gcse.o \
ggc-common.o \
gimple.o \


[Bug c/61900] New: loc_descr_plus_const sanitizer runtime error in xgcc while building libgcc_s

2014-07-24 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61900

Bug ID: 61900
   Summary: loc_descr_plus_const sanitizer runtime error in xgcc
while building libgcc_s
   Product: gcc
   Version: 4.9.1
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zeccav at gmail dot com

While building gcc/libgcc_s and using -fsanitize=undefined a runtime error is
detected in dwarf2out.c:1488:53
loc-dw_loc_next = int_loc_descriptor (-offset);
because offset==LONG_MIN
This is on x86-64.
The sanitizer exact message is
../../gcc-4.9.1/gcc/dwarf2out.c:1488:53: runtime error: 
negation of -9223372036854775808 cannot be represented in type 'long int'; 
cast to an unsigned type to negate this value to itself

This is in xgcc compiling bid128_add.c/bid128_to_int32.c/bid128_to_uint32.c
bid128_to_int64.c/bid128_to_uint64.c