[Bug middle-end/77671] missing -Wformat-length warning on sprintf overflow with "%s"

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77671

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
That is because the latter is folded into strcpy early by
gimple_fold_builtin_sprintf (already during the gimplification).
I'm certainly surprised we do it even at -O0, IMHO we shouldn't.  But whether
for -O and above we want to defer until after the lowering passes are done so
that your pass can do something about that is another thing.

[Bug middle-end/77673] New: 4-byte load generated instead of 1-byte load, possibly reading past the end of object

2016-09-21 Thread laurynas.biveinis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673

Bug ID: 77673
   Summary: 4-byte load generated instead of 1-byte load, possibly
reading past the end of object
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: laurynas.biveinis at gmail dot com
  Target Milestone: ---

For the following function

void mach_parse_compressed(unsigned char* ptr, unsigned long int* val)
{
if (ptr[0] < 0xC0U) {
*val = ptr[0] + ptr[1];
return;
}

  *val = ((unsigned long int)(ptr[0]) << 24)
  | ((unsigned long int)(ptr[1]) << 16)
  | ((unsigned long int)(ptr[2]) << 8)
  | ptr[3];
}

starting with GCC 5.1, with -O2 -fPIC, the following is generated on x86_64:

mach_parse_compressed(unsigned char*, unsigned long*):
movl(%rdi), %eax <--- this load is not safe before branching
bswap   %eax
movl%eax, %edx
movzbl  (%rdi), %eax
cmpb$-65, %al
jbe .L5
movl%edx, %eax
movq%rax, (%rsi)
ret
.L5:
movzbl  1(%rdi), %edx
addl%edx, %eax
cltq
movq%rax, (%rsi)
ret

"movl(%rdi), %eax" loads all of ptr[0]..ptr[3] even though before we
compare ptr[0] with 0xC0U, we don't know whether we can assume that
ptr[1]..ptr[3] does not point past the end of an object.

GCC 5.1/5.2/5.3/5.4/6.1/6.2 are all affected. Versions 4.7, 4.8, 4.9 are not. I
have checked this using Ubuntu GCC build and http://gcc.godbolt.org/. If
necessary, I can build GCC from pristine .tar.gz and re-test.

[Bug middle-end/77673] 4-byte load generated instead of 1-byte load, possibly reading past the end of object

2016-09-21 Thread laurynas.biveinis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673

Laurynas Biveinis  changed:

   What|Removed |Added

 CC||laurynas.biveinis at gmail dot 
com

--- Comment #1 from Laurynas Biveinis  ---
Created attachment 39663
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39663&action=edit
Test program containing the function for Valgrind/ASan/memory protection errors

A test program for Linux to show the various ASan/Valgrind/SIGSEGV error this
bug produces.

[Bug tree-optimization/77673] [5/6/7 Regression] 4-byte load generated instead of 1-byte load, possibly reading past the end of object

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
  Component|middle-end  |tree-optimization
   Target Milestone|--- |5.5
Summary|4-byte load generated   |[5/6/7 Regression] 4-byte
   |instead of 1-byte load, |load generated instead of
   |possibly reading past the   |1-byte load, possibly
   |end of object   |reading past the end of
   ||object
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
Confirmed.
The bswap pass is putting the word load and __builtin_bswap after the first
load instead right after the last load.

[Bug tree-optimization/77621] [6/7 Regression] Internal compiler error for mtune=atom + msse2

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77621

--- Comment #20 from Richard Biener  ---
Author: rguenth
Date: Wed Sep 21 07:37:18 2016
New Revision: 240302

URL: https://gcc.gnu.org/viewcvs?rev=240302&root=gcc&view=rev
Log:
2016-09-21  Richard Biener  
Jakub Jelinek  

PR tree-optimization/77621
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Split
group at non-vectorizable stmts.

* gcc.dg/pr77621.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/pr77621.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-data-refs.c

[Bug c++/67273] Incorrect -Wshadow warning with generic lambdas

2016-09-21 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67273

lh_mouse  changed:

   What|Removed |Added

 CC||lh_mouse at 126 dot com

--- Comment #1 from lh_mouse  ---
Not very sure whether it is related to this one:

struct foo {
template
void iterate(F f){
int i = 1;
f(i);
}
void kick(){
iterate([&](auto i){ });
}
};

Replacing `auto` with `int` gets rid of the warning.

[Bug tree-optimization/77648] [5/6/7 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Wed Sep 21 07:38:33 2016
New Revision: 240303

URL: https://gcc.gnu.org/viewcvs?rev=240303&root=gcc&view=rev
Log:
2016-09-21  Richard Biener  

PR tree-optimization/77648
* tree-ssa-structalias.c (process_constraint): Handle all DEREF
with complex RHS.
(make_transitive_closure_constraints): Adjust comment.
(make_any_offset_constraints): New function.
(handle_rhs_call): Make sure to first expand a pointer to all
subfields before transitively closing it.
(handle_const_call): Likewise.  Properly expand returned
pointers as well.
(handle_pure_call): Likewise.

* gcc.dg/torture/pr77648-1.c: New testcase.
* gcc.dg/torture/pr77648-2.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr77648-1.c
trunk/gcc/testsuite/gcc.dg/torture/pr77648-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-structalias.c

[Bug tree-optimization/77648] [5/6 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

Richard Biener  changed:

   What|Removed |Added

  Known to work||7.0
Summary|[5/6/7 Regression] Setting  |[5/6 Regression] Setting
   |conversion to a integer to  |conversion to a integer to
   |double to 0 3/4 through a   |double to 0 3/4 through a
   |loop|loop
  Known to fail|7.0 |

--- Comment #8 from Richard Biener  ---
Fixed on trunk sofar.

[Bug tree-optimization/77621] [6 Regression] Internal compiler error for mtune=atom + msse2

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77621

Richard Biener  changed:

   What|Removed |Added

  Known to work||7.0
Summary|[6/7 Regression] Internal   |[6 Regression] Internal
   |compiler error for  |compiler error for
   |mtune=atom + msse2  |mtune=atom + msse2
  Known to fail||6.2.0

--- Comment #21 from Richard Biener  ---
Fixed on trunk sofar.

[Bug target/77669] Incorrect LTO code on embedded ARM

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77669

Richard Biener  changed:

   What|Removed |Added

   Keywords||lto
 Target||arm
 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2016-09-21
 Ever confirmed|0   |1

--- Comment #3 from Richard Biener  ---
Unless you can provide a complete testcase that compiles to sth executable it's
not possible to help you in debugging this.

LTO may cause static variable constructors to run in a different order than
when not using LTO (but they still behave according to the language rules
which basically make ordering unspecififed AFAIR).

[Bug tree-optimization/77665] [5/6/7 Regression] ICE in expand_GOMP_SIMD_VF, at internal-fn.c:172

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77665

Richard Biener  changed:

   What|Removed |Added

  Component|fortran |tree-optimization
   Target Milestone|--- |5.5
Summary|ICE in expand_GOMP_SIMD_VF, |[5/6/7 Regression] ICE in
   |at internal-fn.c:172|expand_GOMP_SIMD_VF, at
   ||internal-fn.c:172

[Bug target/71767] Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler

2016-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71767

--- Comment #21 from Iain Sandoe  ---
(In reply to Iain Sandoe from comment #20)
> Created attachment 39661 [details]
> patchset cf 240230
> 
> 
> patchset rebased to 240230 - should apply cleanly.

As Dominique pointed out last night, g++.dg/abi/key2.C needs adjustment.

This is supposed to test that we emit the right sections for things that need
coalescing - which now only applies to older linkers.  So the fix here is to
make it test for correct output with a forced old linker.

We could add a new test to see that the non _coal,coalesced sections are
emitted for new linkers, but that's probably a moot point since many other
tests would fails (as per this PR).

---

diff --git a/gcc/testsuite/g++.dg/abi/key2.C b/gcc/testsuite/g++.dg/abi/key2.C
index 0d1347a..c79b3b2 100644
--- a/gcc/testsuite/g++.dg/abi/key2.C
+++ b/gcc/testsuite/g++.dg/abi/key2.C
@@ -2,6 +2,7 @@
 // PR darwin/25908

 // { dg-do compile { target *-*-darwin* } }
+// { dg-options "-mtarget-linker 85.2" }
 // { dg-final { scan-assembler ".globl __ZTV1f\\n  .weak_definition
__ZTV1f(\\n.section __DATA,__const_coal,coalesced)?\\n .align" } }
 // { dg-final { scan-assembler ".globl __ZTS1f\\n  .weak_definition
__ZTS1f\\n .section __TEXT,__const_coal,coalesced" } }
 // { dg-final { scan-assembler ".globl __ZTI1f\\n  .weak_definition
__ZTI1f(\\n.section __DATA,__const_coal,coalesced)?\\n .align" } }

[Bug tree-optimization/77644] missed optimization with sqrt in comparison

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77644

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||easyhack
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Confirmed, This shouldn't be a hard project just starting out and they can
modify match.pd to do it.

[Bug middle-end/60762] [ASAN] -fsanitize=address fails with LTO

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60762

--- Comment #2 from Andrew Pinski  ---
does this work now?

[Bug target/52795] FAIL: gcc.dg/tree-prof/pr34999.c compilation, -fprofile-use -D_PROFILE_USE on {x86_64,i386}-apple-darwin{10,11} at -m64

2016-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52795

--- Comment #6 from Iain Sandoe  ---
Created attachment 39664
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39664&action=edit
Reorganize hot/cold output to allow atoms to be properly detected.


This is a proof-of-principle patch that reorganizes the output of the hot/cold
partitions so that section switches are only made when needed.  Although it was
done to make the atom detection work with ld64, IMO - it makes the asm more
readable for linux too... but that's a side-effect of course.

This is a very invasive patch, because it touches debug output - so some way to
test more widely would be needed.  However, worth testing as a resolution for
this problem.

[Bug target/52795] FAIL: gcc.dg/tree-prof/pr34999.c compilation, -fprofile-use -D_PROFILE_USE on {x86_64,i386}-apple-darwin{10,11} at -m64

2016-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52795

--- Comment #7 from Iain Sandoe  ---
(In reply to Dominique d'Humieres from comment #5)
> This PR seems fixed on x86_64-apple-darwin14.5 with Xcode 7.

I don't think it's actually "fixed" as such, the newer linkers are capable of
handling symbol aliasing - so probably there's no reported error/warning but
likely the atoms are still not correctly detected (however, I've not proved
this assertion).

[Bug c++/77616] A variadic polymorphic lambda call fails with zero arguments

2016-09-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77616

Paolo Carlini  changed:

   What|Removed |Added

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

--- Comment #2 from Paolo Carlini  ---
Dup.

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

[Bug c++/64095] [C++14] Ellipsis at end of generic lambda parameter-declaration-clause should be parsed as a parameter pack

2016-09-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64095

--- Comment #2 from Paolo Carlini  ---
*** Bug 77616 has been marked as a duplicate of this bug. ***

[Bug target/52795] FAIL: gcc.dg/tree-prof/pr34999.c compilation, -fprofile-use -D_PROFILE_USE on {x86_64,i386}-apple-darwin{10,11} at -m64

2016-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52795

--- Comment #8 from Iain Sandoe  ---
(In reply to Iain Sandoe from comment #6)
> Created attachment 39664 [details]
> Reorganize hot/cold output to allow atoms to be properly detected.
> 
> 
> This is a proof-of-principle patch that reorganizes the output of the
> hot/cold partitions so that section switches are only made when needed. 
> Although it was done to make the atom detection work with ld64, IMO - it
> makes the asm more readable for linux too... but that's a side-effect of
> course.
> 
> This is a very invasive patch, because it touches debug output - so some way
> to test more widely would be needed.  However, worth testing as a resolution
> for this problem.

NOTE: this is intended to apply on top of the patch set for PR71767.

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

--- Comment #38 from Andrew Pinski  ---
Does this work now?

[Bug rtl-optimization/61926] const-anchor optimisation is sensitive to ordering

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61926

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
Confirmed.

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

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61845

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
Fixed a long time ago so closing

[Bug sanitizer/65828] [LTO] ICE in streamer_get_builtin_tree, at tree-streamer-in.c:1127

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65828

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2016-09-21
 Ever confirmed|0   |1

--- Comment #10 from Andrew Pinski  ---
Can you produce a testcase,  there is a guide here:
https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

--- Comment #39 from Richard Biener  ---
I believe the --disable-checking issue on ppc is still there.  Wonder if
somebody can try on ppc-linux ... (or other archs, I believe just nobody uses
--disable-checking)

[Bug target/77326] [avr] Invalid optimization using varargs and a weak function

2016-09-21 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326

--- Comment #2 from Georg-Johann Lay  ---
Author: gjl
Date: Wed Sep 21 09:17:32 2016
New Revision: 240306

URL: https://gcc.gnu.org/viewcvs?rev=240306&root=gcc&view=rev
Log:
gcc/
PR target/77326
* config/avr/avr.c (avr_notice_update_cc) [CC_NONE]: If insn
touches some regs mentioned in cc_status, do CC_STATUS_INIT.
gcc/testsuite/
PR target/77326
* gcc.target/avr/torture/pr77326.c: New test.


Added:
trunk/gcc/testsuite/gcc.target/avr/torture/pr77326.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/66012] Sub-optimal 64bit load is generated instead of zero-extension

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66012

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2015-12-23 00:00:00 |2016-9-21

--- Comment #4 from Andrew Pinski  ---
On the trunk we generate one 32bit load and one 64bit load (at least for
aarch64):
test:
adrpx0, l
add x1, x0, :lo12:l
ldr w0, [x0, #:lo12:l]   ; 32bit load to w0
ldr x1, [x1, 8]  ; 64bit load to x1
orr x0, x0, x1, lsl 32
ret

[Bug c++/77651] [7 Regression] c++ -Wno-aligned-new ICEs

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77651

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek  ---
Created attachment 39665
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39665&action=edit
gcc7-pr77651.patch

Untested fix.

[Bug target/77326] [avr] Invalid optimization using varargs and a weak function

2016-09-21 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326

--- Comment #3 from Georg-Johann Lay  ---
Author: gjl
Date: Wed Sep 21 09:31:38 2016
New Revision: 240308

URL: https://gcc.gnu.org/viewcvs?rev=240308&root=gcc&view=rev
Log:
Backport from 2016-09-21 trunk r240306.
PR target/77326
* config/avr/avr.c (avr_notice_update_cc) [CC_NONE]: If insn
touches some regs mentioned in cc_status, do CC_STATUS_INIT.


Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/avr/torture/pr77326.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/avr/avr.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/77664] Missed optimization: signed int >= 0 && < unsigned short

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77664

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Well, IMHO we want to do it not just when you have a >= 0 & a < x
where x is known to have the MSB (from range info) in the comparison type
clear, but also if there is && or the conditions are possibly appart, say
if (a >= 0 && d && e != 21 && f && a < b) etc.
So, I'd think that tree-ssa-reassoc.c would be a better place to optimize this.

So, init_range_entry would need to be taught to handle
GT_EXPR/GE_EXPR/LT_EXPR/LE_EXPR with non-INTEGER_CST second argument by
creating an entry with "symbolic" high and constant low, range_entry_cmp to
sort those last and then deal with it when merging ranges.

[Bug ipa/77674] New: ICE in binds_to_current_def_p with -fkeep-inline-functions

2016-09-21 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77674

Bug ID: 77674
   Summary: ICE in binds_to_current_def_p with
-fkeep-inline-functions
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bernds at gcc dot gnu.org
  Target Milestone: ---

Testcase:

typedef struct { } __fsid_t;
typedef unsigned long int pthread_t;
extern "C" {
  extern __inline __attribute__ ((__gnu_inline__)) int pthread_equal (pthread_t
__thread1, pthread_t __thread2) throw ()   {
  }
}
typedef pthread_t __gthread_t;
static __typeof (pthread_equal)  __gthrw_pthread_equal __attribute__
((__weakref__ ("pthread_equal")));

static inline int __gthread_equal (__gthread_t __t1, __gthread_t __t2)
{
  return __gthrw_pthread_equal (__t1, __t2);
}

Command line (with a normal x86_64-linux compiler):
./cc1plus red4.ii -fpreprocessed -O2 -fkeep-inline-functions -quiet

And the crash:
_ZL21__gthrw_pthread_equalmm/1 (int __gthrw_pthread_equal(pthread_t,
pthread_t)) @0x7f30053f8170
  Type: function definition analyzed alias transparent_alias weakref
  Visibility: weak
  References: pthread_equal/0 (alias)
  Referring: 
  Availability: available
  First run: 0
  Function flags: process
  Called by: _ZL15__gthread_equalmm/2 (1.00 per call) 
  Calls: 
red4.ii: In function ‘int pthread_equal(pthread_t, pthread_t)’:
red4.ii:13:1: internal compiler error: in binds_to_current_def_p, at
symtab.c:2232
 }
 ^
0xa5e668 symtab_node::binds_to_current_def_p(symtab_node*)
../../git/gcc/symtab.c:2232
0xa67d59 set_const_flag_1
../../git/gcc/cgraph.c:2500
0xa67c6c set_const_flag_1
../../git/gcc/cgraph.c:2531
0xa67fdf cgraph_node::set_const_flag(bool, bool)
../../git/gcc/cgraph.c:2562
0x15d05e1 execute
../../git/gcc/ipa-pure-const.c:1831
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/72774] [7 Regression] ICE on invalid C++ code on x86_64-linux-gnu (tree check: expected tree that contains ‘decl minimal’ structure, have ‘tree_list’ in consider_binding_level, at cp/name-loo

2016-09-21 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72774

Bernd Schmidt  changed:

   What|Removed |Added

 CC||bernds at gcc dot gnu.org

--- Comment #2 from Bernd Schmidt  ---
I had multidelta reduce a testcase to something that produces the same error -
most likely the same bug.

namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
{
  template < typename _Tp > struct __add_unsigned
  {
  };
  class locale;

template < typename _CharT, typename _InIter > class num_get:public
locale::facet
  {
typedef _InIter iter_type;
template < typename _ValueT >
  __attribute ((__abi_tag__ ("cxx11"))) iter_type
  _M_extract_int (iter_type, iter_type, int &, ios_base::iostate &,
  _ValueT &) const;
  }
  template < typename _CharT,
typename _InIter > template < typename _ValueT >
__attribute ((__abi_tag__ ("cxx11"))) _InIter num_get < _CharT,
_InIter >::_M_extract_int (_InIter __beg, _InIter __end, ios_base & __io,
   ios_base::iostate & __err,
   _ValueT & __v) const const
  {
using __gnu_cxx::__add_unsigned;
typedef __numpunct_cache < _CharT > __cache_type;

[Bug tree-optimization/77644] missed optimization with sqrt in comparison

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77644

--- Comment #2 from Richard Biener  ---
Well, even generally sqrt (X) CMP sqrt (Y) -> X CMP Y at least if there are no
NaNs and with -funsafe-math-optimization (because rounding effects could make
sqrt (X) == sqrt (Y) when X != Y).

[Bug c/77675] New: optimization level==number of -Wformat-length warnings

2016-09-21 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77675

Bug ID: 77675
   Summary: optimization level==number of -Wformat-length warnings
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

Created attachment 39666
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39666&action=edit
unreduced testcase

Consider the attached unreduced testcase. The number of redundant warnings
increases with the -O level due to inlining:

markus@x4 /tmp % gcc -O1 -c -Wformat-length algapi.i
crypto/algapi.c: In function ‘crypto_inst_setname’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64

markus@x4 /tmp % cc -O2 -c -Wformat-length algapi.i
crypto/algapi.c: In function ‘crypto_inst_setname’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64
crypto/algapi.c: In function ‘crypto_alloc_instance2’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64

markus@x4 /tmp % gcc -O3 -c -Wformat-length algapi.i
crypto/algapi.c: In function ‘crypto_inst_setname’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64
crypto/algapi.c: In function ‘crypto_alloc_instance2’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64
crypto/algapi.c: In function ‘crypto_alloc_instance’:
crypto/algapi.c:817:6: warning: output may be truncated at or before format
character ‘)’ at offset 5 [-Wformat-length=]
crypto/algapi.c:817:6: note: format output between 3 and 66 bytes into a
destination of size 64

[Bug target/71767] Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler

2016-09-21 Thread fxcoudert at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71767

Francois-Xavier Coudert  changed:

   What|Removed |Added

 CC||fxcoudert at gcc dot gnu.org

--- Comment #22 from Francois-Xavier Coudert  ---
When a fix is designed, could you please backport it to the 6 branch (so it can
make it into 6.3 for example)? It is also affected.

[Bug tree-optimization/77665] [5/6/7 Regression] ICE in expand_GOMP_SIMD_VF, at internal-fn.c:172

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77665

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
Created attachment 39667
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39667&action=edit
gcc7-pr77665.patch

Untested fix.

[Bug ipa/77674] [7 Regression] ICE in binds_to_current_def_p with -fkeep-inline-functions

2016-09-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77674

Richard Biener  changed:

   What|Removed |Added

 Target||x86_64-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
 CC||hubicka at gcc dot gnu.org
  Known to work||6.2.0
   Target Milestone|--- |7.0
Summary|ICE in  |[7 Regression] ICE in
   |binds_to_current_def_p with |binds_to_current_def_p with
   |-fkeep-inline-functions |-fkeep-inline-functions
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.

[Bug target/77676] New: powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

Bug ID: 77676
   Summary: powerpc64 and powerpc64le stage2 bootstrap fail
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: amodra at gmail dot com
  Target Milestone: ---

Created attachment 39668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39668&action=edit
testcase

The attached testcase taken from rs6000.c output_cbranch shows a wrong
optimisation of sprintf to strcpy when compiled with -O2 -Wall.  Yes, -Wall
seems to be necessary.

[Bug ipa/77674] [7 Regression] ICE in binds_to_current_def_p with -fkeep-inline-functions

2016-09-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77674

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
Started with r235065.

[Bug target/71767] Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler

2016-09-21 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71767

--- Comment #23 from Iain Sandoe  ---
(In reply to Francois-Xavier Coudert from comment #22)
> When a fix is designed, could you please backport it to the 6 branch (so it
> can make it into 6.3 for example)? It is also affected.

sure, "all open branches" would be the intent.

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
 CC||jakub at gcc dot gnu.org,
   ||msebor at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
This looks like a major flaw in the gimple-ssa-sprintf.c stuff.
In particular, -W* options should not affect code generationm but the file is
full of conditionals on warn_format_length value.  I think the only way out of
this is to separate the warning handling from the flag_printf_return_value
handling, it can be done by the same functions, but it should differentiate
between warning (then emit warnings, but don't change anything, honor
warn_format_length, ignore flag_printf_return_value), and code changes (in that
case it shouldn't emit warnings, it should ignore warn_format_length, honor
flag_printf_return_value).
I suppose easiest would be to add some boolean into format_result, and:
  if (warn_format_length)
{
  format_result res = format_result (false);
  compute_format_length (info, &res);
}

  if (flag_printf_return_value && optimize > 0)
{
  format_result res = format_result (true);
  compute_format_length (info, &res);
  if (!flag_rounding_math || !res.floating)
try_substitute_return_value (gsi, info, res);
}

[Bug tree-optimization/77550] [6/7 Regression] std::deque with -O3 has infinite std::distance

2016-09-21 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77550

--- Comment #17 from Bernd Edlinger  ---
Author: edlinger
Date: Wed Sep 21 13:03:59 2016
New Revision: 240313

URL: https://gcc.gnu.org/viewcvs?rev=240313&root=gcc&view=rev
Log:
gcc:
2016-09-21  Bernd Edlinger  

PR tree-optimization/77550
* tree-vect-stmts.c (create_array_ref): Change parameters.
(get_group_alias_ptr_type): New function.
(vectorizable_store, vectorizable_load): Use get_group_alias_ptr_type.

testsuite:
2016-09-21  Bernd Edlinger  

PR tree-optimization/77550
* g++.dg/pr77550.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/pr77550.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-stmts.c

[Bug fortran/77657] link error with implementation of user-defined derived type input/output (UD-DTIO) in child extending abstract parent

2016-09-21 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77657

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Paul Thomas  ---
Fixed on trunk.

Thanks for the report.

Paul

[Bug tree-optimization/77648] [5/6 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2016-09-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

--- Comment #9 from Dominique d'Humieres  ---
> Contains two C testcases -- the Fortran bug is in another code path,
> a Fortran testcase suitable for the testsuite would be appreciated
> (single-file, runtime, fails without, passes with the patch). 
> Unfortunately(?) there is no way to create "fn spec" attributes in C test 
> cases.

I have tried to reduce the Fortran test case, but I did not succeeded. The bad
news is that the bug is gone if all the files are merged in one.

Raymond can you please try to reduce your test?

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
Uh, if a warning affects code generation, then that needs to be fixed.  E.g.   
-Wwrite-strings has the same problem.

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #3 from Alan Modra  ---
Bisect points to git commit b9833bfd, svn rev 240298.

[Bug tree-optimization/77318] [7 regression] FAIL: gfortran.dg/graphite/pr68279.f90 -O (internal compiler error)

2016-09-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77318

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #7 from Dominique d'Humieres  ---
*** Bug 71348 has been marked as a duplicate of this bug. ***

[Bug middle-end/71348] [7 Regression] FAIL: gfortran.dg/graphite/pr68279.f90

2016-09-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71348

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Dominique d'Humieres  ---
Duplicate of pr77318.

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

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #4 from Dominique d'Humieres  ---
> Bisect points to git commit b9833bfd, svn r240298.

It also breaks bootstrap on i386, see
https://gcc.gnu.org/ml/gcc-regression/2016-09/ and x86_64-apple-darwin15:

../../work/gcc/varasm.c: In function 'rtx_def* assemble_static_space(long long
unsigned int)':
../../work/gcc/varasm.c:2571:1: error: '%ld' directive writing between 1 and 11
bytes into a region of size 9 [-Werror=format-length=]
 assemble_static_space (unsigned HOST_WIDE_INT size)
 ^
../../work/gcc/varasm.c:2571:1: note: directive argument in the range
[-2147483648l, 2147483647l]
In file included from ./tm.h:21:0,
 from ../../work/gcc/backend.h:28,
 from ../../work/gcc/varasm.c:31:
../../work/gcc/config/darwin.h:754:53: note: format output between 5 and 15
bytes into a destination of size 12
   sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \
 ^
../../work/gcc/varasm.c:2577:3: note: in expansion of macro
'ASM_GENERATE_INTERNAL_LABEL'
   ASM_GENERATE_INTERNAL_LABEL (name, "LF", const_labelno);
   ^~~

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #5 from Segher Boessenkool  ---
Could this be reverted for now please, until the bootstrap errors are fixed?

[Bug tree-optimization/77648] [5/6 Regression] Setting conversion to a integer to double to 0 3/4 through a loop

2016-09-21 Thread raynman4451 at tamu dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77648

--- Comment #10 from Raymond Fontenot  ---
Yeah I'll see what I can do about simplifying the test case.
~Raymond

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #6 from Jakub Jelinek  ---
Perhaps it would be enough to just disable the pass for now (comment out in the
gate), so that the whole file isn't reverted.

It breaks i686-linux bootstrap as well, on the following testcase reduced from
vec.c:
struct A
{
  const char *a;
  int b;
  const char *c;
};
void bar (char *);

void
foo (struct A *p)
{
  char s[4096];
  const char *u = p->a;
  const char *t;
  while ((t = __builtin_strstr (u, "gcc/")))
u = t + 4;
  __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
  bar (s);
}
I'm getting with -O2 -Wformat-length -m32:
vec.c: In function ‘foo’:
vec.c:17:26: warning: ‘%s’ directive writing between 0 and 4294967295 bytes
into a region of size 4096 [-Wformat-length=]
   __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
  ^~
vec.c:17:3: note: format output between 6 and 4294967311 bytes into a
destination of size 4096
   __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
   ^~
while no warnings at -O2 -Wformat-length -m64.

[Bug target/77326] [avr] Invalid optimization using varargs and a weak function

2016-09-21 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326

--- Comment #4 from Georg-Johann Lay  ---
Author: gjl
Date: Wed Sep 21 14:11:59 2016
New Revision: 240315

URL: https://gcc.gnu.org/viewcvs?rev=240315&root=gcc&view=rev
Log:
gcc/
Backport from 2016-09-21 trunk r240306.
PR target/77326
* config/avr/avr.c (hard-reg-set.h): Move #include up in front
of rtl.h to that HARD_CONST is defined in rtl.h.
(avr_notice_update_cc) [CC_NONE]: If insn touches some regs
mentioned in cc_status, do CC_STATUS_INIT.

gcc/testsuite/
Backport from 2016-09-21 trunk r240306.
PR target/77326
* gcc.target/avr/torture/pr77326.c: New test.


Added:
branches/gcc-5-branch/gcc/testsuite/gcc.target/avr/torture/pr77326.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/avr/avr.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug target/77326] [avr] Invalid optimization omits comparison

2016-09-21 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326

Georg-Johann Lay  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |RESOLVED
 CC||gjl at gcc dot gnu.org
 Resolution|--- |FIXED
Summary|[avr] Invalid optimization  |[avr] Invalid optimization
   |using varargs and a weak|omits comparison
   |function|

--- Comment #5 from Georg-Johann Lay  ---
Fixed in 5.5 and 6.3+.

Also changed the bug title because the issue has nothing to do with varargs or
weak; these features just appened to be present in a test case demonstrating
the problem.

[Bug sanitizer/77567] ASAN: Bugus error "alloc-dealloc-mismatch (malloc vs operator delete [])" with C++17's over-aligned types

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77567

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Wed Sep 21 14:40:30 2016
New Revision: 240316

URL: https://gcc.gnu.org/viewcvs?rev=240316&root=gcc&view=rev
Log:
PR sanitizer/77567
* asan/asan_new_delete.cc: Cherry-pick upstream r282019.

Modified:
trunk/libsanitizer/ChangeLog
trunk/libsanitizer/asan/asan_new_delete.cc

[Bug target/77478] Incorrect code generated with -O3, m32, -msse2 and -ffast-math

2016-09-21 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77478

--- Comment #7 from Alexander Monakov  ---
Richard, I don't believe this is a dup. According to my git-bisect, this was
fixed or made latent during gcc-6 development by your patch:

https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00120.html
[PATCH] Consolidate alignment folding
(this is r225310 on trunk)

How to go forward from here?

(about the alignment dumping patchlet, I think it would be nice to have this
functionality on trunk, can I help with that? is there something I'm missing
about this patch that makes it unsuitable for trunk as-is?)

[Bug c++/77651] [7 Regression] c++ -Wno-aligned-new ICEs

2016-09-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77651

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Wed Sep 21 15:13:46 2016
New Revision: 240317

URL: https://gcc.gnu.org/viewcvs?rev=240317&root=gcc&view=rev
Log:
PR c++/77651
c-family/
* c.opt (Waligned-new=): Add RejectNegative.
(faligned-new=): Likewise.  Spelling fix - change
aligned_new_threshhold to aligned_new_threshold.
* c-cppbuiltin.c (c_cpp_builtins): Change aligned_new_threshhold
to aligned_new_threshold.
cp/
* init.c (build_new_1): Don't suggest to use -faligned-new if
aligned_new_threshold is non-zero.
(type_has_new_extended_alignment): Change aligned_new_threshhold
to aligned_new_threshold.
* call.c (second_parm_is_size_t, aligned_allocation_fn_p,
aligned_deallocation_fn_p, build_op_delete_call): Likewise.
* decl.c (cxx_init_decl_processing): Likewise.
testsuite/
* g++.dg/cpp1z/aligned-new6.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/aligned-new6.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-cppbuiltin.c
trunk/gcc/c-family/c.opt
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #40 from Eric Botcazou  ---
> I believe the --disable-checking issue on ppc is still there.  Wonder if
> somebody can try on ppc-linux ... (or other archs, I believe just nobody
> uses --disable-checking)

Bootstrap with --disable-checking on 32-bit PowerPC/Linux is OK on mainline.

[Bug debug/72828] ICE in clone_tree_partial when compiling with -fdebug-types-section

2016-09-21 Thread jim at meyering dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72828

jim at meyering dot net changed:

   What|Removed |Added

 CC||jim at meyering dot net

--- Comment #6 from jim at meyering dot net ---
I have just confirmed that this still elicits an ICE using Monday's just-built
compiler: 

gcc version 7.0.0 20160919 (experimental) (GCC)

[Bug sanitizer/77567] ASAN: Bugus error "alloc-dealloc-mismatch (malloc vs operator delete [])" with C++17's over-aligned types

2016-09-21 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77567

--- Comment #9 from Tobias Burnus  ---
For completeness, upstream review is at https://reviews.llvm.org/D24771

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

Martin Sebor  changed:

   What|Removed |Added

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

--- Comment #7 from Martin Sebor  ---
The optimization is meant to be independent of the warning.  If it isn't it's a
bug in the code.

I successfully tested the pass on powerpc64le just last week, but I did not
test it on any ILP32 targets.  Let me look into this.

In the meantime, the optimization can be disabled by initializing the
-fprintf-return-value option to 0, without disabling anything else.

[Bug fortran/48298] [F03] User-Defined Derived-Type IO (DTIO)

2016-09-21 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48298

--- Comment #21 from Jerry DeLisle  ---
Created attachment 39669
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39669&action=edit
Revised patch for review/testing

This revised patch speeds up execution on non DTIO internal units by saving and
reusing the unit structure, avoiding memory allocations.  I am still testing.
So far it passes regression tests.

[Bug libfortran/71363] Issue when sizeof(double) = sizeof(long double)

2016-09-21 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #2 from Jerry DeLisle  ---
(In reply to Paul Mustiere from comment #0)
> Hello,
> 
> I am building the GNU toolchain for Android with support for Fortran, and
> encountered an issue when targeting x86 for the runtime library.
> 
> Note: I'm using the toolchain sources provided by Google, but as far as I
> can tell the Fortran part is simply 4.9 since they are not trying to build
> with Fortran.
> 
> In intrisics/cshift0.c, I get a 'duplicate case value'
> (http://paste.ubuntu.com/16861425/). As far as I can tell:
> 
> - GFC_DTYPE_REAL_16 is defined (but not GFC_DTYPE_REAL_10), hence
> GFC_REAL_16 is defined as long double.
> - sizeof(long double) = sizeof(double) = 8, which causes the duplicate case.
> 
> I find a workaround which consists of detecting both sizes in mk-kinds-h.sh
> and checking that they are not equal before defining GFC_REAL_16. The rest
> of the toolchain compiles fine, but I am not sure it's ideal.
> Also, I'm curious as to why Fortran seems to be fine with real (kind=16) but
> C doesn't seem to be able to hold variables that big.
> 
> I know I'm not using the regular GNU toolchain but any help is appreciated.
> 
> Cheers,
> Paul Mustiere

Paul,

Look for where "for k in $possible_real_kinds" is in the mk-kinds script. Where
is $possible_real_kinds set?

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #8 from Martin Sebor  ---
Author: msebor
Date: Wed Sep 21 16:13:12 2016
New Revision: 240321

URL: https://gcc.gnu.org/viewcvs?rev=240321&root=gcc&view=rev
Log:
PR bootstrap/77676 - powerpc64 and powerpc64le stage2 bootstrap fail

* c.opt (fprintf-return-value): Temporarily initialize to zero
to unblock bootstrap failures.


Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c.opt

[Bug libfortran/71363] Issue when sizeof(double) = sizeof(long double)

2016-09-21 Thread paul.mustiere at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363

--- Comment #3 from Paul Mustiere  ---
In the script:
possible_real_kinds="4 8 10 16" i.e. it tries them all

In the for loop, when it tries to compile the dummy Fortran program to check
each kind=k existance, only 4, 8 & 16 exists.

kind=4 is defined as float,
kind=8 is defined as double,
kind=16 is defined as long double.

The issue being that long double = double in this case.

When kind=16 match in C is defined, there's the check:
16) if [ $long_double_kind -eq 10 ]; then

Could it be that kind=16 should be match to __float128,
and the check should be $long_double_kind -neq 16?

[Bug target/77326] [avr] Invalid optimization omits comparison

2016-09-21 Thread matthijs at stdin dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77326

--- Comment #6 from Matthijs Kooijman  ---
Thanks!

[Bug libfortran/71363] Issue when sizeof(double) = sizeof(long double)

2016-09-21 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363

--- Comment #5 from Steve Kargl  ---
On Wed, Sep 21, 2016 at 04:25:00PM +, jvdelisle at gcc dot gnu.org wrote:
> 
> I will try to study the script some more later today. Changing status to
> unconfirmed while we look into this a bit.
> 

I closed this bug a long time ago, because the initial report
indicated that OP was not using GCC sources.  OP is using 
something supplied by Google for Android.  This is not a 
gfortran problem.

[Bug libfortran/71363] Issue when sizeof(double) = sizeof(long double)

2016-09-21 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363

Jerry DeLisle  changed:

   What|Removed |Added

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

--- Comment #4 from Jerry DeLisle  ---
(In reply to Paul Mustiere from comment #3)
---snip---
> 
> The issue being that long double = double in this case.
> 
> When kind=16 match in C is defined, there's the check:
> 16) if [ $long_double_kind -eq 10 ]; then
> 
> Could it be that kind=16 should be match to __float128,
> and the check should be $long_double_kind -neq 16?

kind=16 is float128.  So something wrong if long double = double

I will try to study the script some more later today. Changing status to
unconfirmed while we look into this a bit.

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #9 from Martin Sebor  ---
I found the problem responsible for the incorrect code generation but I have
disabled the optimization until I have a robust solution.  The ILP32 warning in
comment #6 is a separate issue.  I'm looking into it.

The warning in comment #4 looks legitimate and should be fixable by enlarging
the destination buffer to 15 bytes as suggested in the note.


[Bug tree-optimization/77677] New: ICE at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in set_value_range, at tree-vrp.c:361)

2016-09-21 Thread chengniansun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77677

Bug ID: 77677
   Summary: ICE at -O1 and above in both 32-bit and 64-bit modes
on x86_64-linux-gnu (internal compiler error: in
set_value_range, at tree-vrp.c:361)
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chengniansun at gmail dot com
  Target Milestone: ---

If I add "int" in front of "p1", then the crash disappears.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160921 (experimental) [trunk revision 240316] (GCC)
$
$ gcc-trunk -O3 small.c
small.c: In function ‘fn1’:
small.c:2:5: warning: type of ‘p1’ defaults to ‘int’ [-Wimplicit-int]
 int fn1(p1) { return p1 == 0 || a % p1; }
 ^~~
small.c: At top level:
small.c:7:1: internal compiler error: in set_value_range, at tree-vrp.c:361
 }
 ^
0xe61ec8 set_value_range
../../gcc-source-trunk/gcc/tree-vrp.c:360
0xe6542e vrp_meet_1
../../gcc-source-trunk/gcc/tree-vrp.c:8639
0xe6542e vrp_meet(value_range*, value_range const*)
../../gcc-source-trunk/gcc/tree-vrp.c:8716
0x12e9ef5 ipcp_vr_lattice::meet_with_1(value_range const*)
../../gcc-source-trunk/gcc/ipa-cp.c:987
0x12f038c ipcp_vr_lattice::meet_with(value_range const*)
../../gcc-source-trunk/gcc/ipa-cp.c:969
0x12f038c propagate_vr_accross_jump_function
../../gcc-source-trunk/gcc/ipa-cp.c:2077
0x12f038c propagate_constants_accross_call
../../gcc-source-trunk/gcc/ipa-cp.c:2435
0x12f2918 propagate_constants_topo
../../gcc-source-trunk/gcc/ipa-cp.c:3329
0x12f2918 ipcp_propagate_stage
../../gcc-source-trunk/gcc/ipa-cp.c:3439
0x12f4b63 ipcp_driver
../../gcc-source-trunk/gcc/ipa-cp.c:5246
0x12f4b63 execute
../../gcc-source-trunk/gcc/ipa-cp.c:5342
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.
$
$ cat small.c
int a, b;
int fn1(p1) { return p1 == 0 || a % p1; }

int main() {
  b = fn1(2592930443);
  return 0;
}
$

[Bug libstdc++/77537] pair constructors do not properly SFINAE

2016-09-21 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77537

--- Comment #2 from ville at gcc dot gnu.org ---
Author: ville
Date: Wed Sep 21 16:48:35 2016
New Revision: 240322

URL: https://gcc.gnu.org/viewcvs?rev=240322&root=gcc&view=rev
Log:
PR libstdc++/77537
Implement LWG 2729 for pair.
* include/bits/stl_pair.h (_PCC): New.
(_ConstructiblePair, _ImplicitlyConvertiblePair):
Turn into static member functions of _PCC.
(_MoveConstructiblePair, _ImplicitlyMoveConvertiblePair): Likewise.
(_PCCP): New.
(pair(const _T1&, const _T2&)): Adjust.
(_PCCFP): New.
(pair(const pair<_U1, _U2>&)): Adjust.
(pair(_U1&&, const _T2&)): Likewise.
(pair(const _T1&, _U2&&)): Likewise.
(pair(_U1&&, _U2&&)): Likewise.
(pair(pair<_U1, _U2>&&)): Likewise.
(operator=(const pair&)): Make conditionally deleted.
(operator=(pair&&)): Make conditionally suppressed.
(operator=(const pair<_U1, _U2>&)): Constrain.
(operator=(pair<_U1, _U2>&&): Likewise.
* include/std/type_traits (__nonesuch): New.
* testsuite/20_util/pair/traits.cc: New.

Added:
trunk/libstdc++-v3/testsuite/20_util/pair/traits.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/stl_pair.h
trunk/libstdc++-v3/include/std/type_traits

[Bug libstdc++/77537] pair constructors do not properly SFINAE

2016-09-21 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77537

Ville Voutilainen  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Ville Voutilainen  ---
Fixed.

[Bug tree-optimization/77677] [7 Regression] ICE at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in set_value_range, at tree-vrp.c:361)

2016-09-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77677

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-21
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |7.0
Summary|ICE at -O1 and above in |[7 Regression] ICE at -O1
   |both 32-bit and 64-bit  |and above in both 32-bit
   |modes on x86_64-linux-gnu   |and 64-bit modes on
   |(internal compiler error:   |x86_64-linux-gnu (internal
   |in set_value_range, at  |compiler error: in
   |tree-vrp.c:361) |set_value_range, at
   ||tree-vrp.c:361)
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread kumba at gentoo dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

--- Comment #41 from Joshua Kinard  ---
(In reply to Andrew Pinski from comment #38)
> Does this work now?

Whatever the issue on MIPS/N32 was, it's resolved by dropping -Wl,-z,now.  So
no longer an issue AFAICT.

[Bug c/77464] gcc -no-pie breaks -shared

2016-09-21 Thread balint at balintreczey dot hu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77464

--- Comment #11 from Balint Reczey  ---
(In reply to Manuel López-Ibáñez from comment #10)
> (In reply to Andrew Pinski from comment #5)
> > (In reply to Manuel López-Ibáñez from comment #3)
> > > Or at least give a clearer error that mentions -fPIC ...
> > 
> > Actually this is not a driver issue just a binutils issue if that. Why add
> > no-pie anyways to the ldflags.
> 
> GCC controls the driver and decides what to pass to the linker.
> 
> (In reply to Andrew Pinski from comment #8)
> > Basically -no-pie says you are now doing an executable overriding the
> > previous -shared.  This is not a bug, you want -no-pie -shared.
> 
> This seems counter-intuitive to how other options work. The documentation
> says nothing about it. Then we wonder why people complain that GCC is harder
> to use/learn.

This is both counter-intuitive and inconvenient but I have to move on.
I take this a WONTFIX and continue paving the way for using
--enable-default-pie in Debian in a less pleasant way.

Thank you at least for the quick response.

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

--- Comment #42 from Andrew Pinski  ---
Closing astatement invalid then.

[Bug bootstrap/66038] [5 regression] (stage 2) build/genmatch issue (gcc/hash-table.h|c) with --disable-checking [ introduced by r218976 ]

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66038

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #43 from Andrew Pinski  ---
.

[Bug libstdc++/77288] Std::experimental::optional::operator= implementation is broken in gcc 6.1

2016-09-21 Thread ville at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77288

--- Comment #8 from ville at gcc dot gnu.org ---
Author: ville
Date: Wed Sep 21 17:37:17 2016
New Revision: 240324

URL: https://gcc.gnu.org/viewcvs?rev=240324&root=gcc&view=rev
Log:
PR libstdc++/77288
* include/std/optional (__is_optional_impl, __is_optional): Remove.
(__converts_from_optional, __assigns_from_optional): New.
(optional(_Up&&)): Use is_same instead of __is_optional.
(optional(const optional<_Up>&)): Constrain with
__converts_from_optional.
(optional(optional<_Up>&&)): Likewise.
(operator=(_Up&&)): Use is_same instead of __is_optional, check
is_same and is_scalar.
(operator=(const optional<_Up>&)): Constrain with
__converts_from_optional and __assigns_from_optional.
(operator=(optional<_Up>&&)): Likewise.
* testsuite/20_util/optional/77288.cc: New.
* testsuite/20_util/optional/cons/value.cc: Adjust.

Added:
trunk/libstdc++-v3/testsuite/20_util/optional/77288.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/optional
trunk/libstdc++-v3/testsuite/20_util/optional/cons/value.cc

[Bug libstdc++/77288] Std::experimental::optional::operator= implementation is broken in gcc 6.1

2016-09-21 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77288

--- Comment #9 from Ville Voutilainen  ---
Fixed on trunk so far.

[Bug libstdc++/77288] Std::experimental::optional::operator= implementation is broken in gcc 6.1

2016-09-21 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77288

--- Comment #10 from Ville Voutilainen  ---
And yes, I plan to port this fix to experimental::optional on trunk and then
backport that.

[Bug c/66008] "section type conflict" if calling a macro inlined or in a two times derived class

2016-09-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66008

Andrew Pinski  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Andrew Pinski  ---
No feedback in over 9 months so closing.

[Bug target/77669] Incorrect LTO code on embedded ARM

2016-09-21 Thread wgh at beyondunreal dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77669

wgh at beyondunreal dot com changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from wgh at beyondunreal dot com ---
I've carefully analyzed the assembly code, and different constructor order was
indeed the case. Thank you for your help.

[Bug fortran/77678] New: ICE in fold_read_from_constant_string, at fold-const.c:13706

2016-09-21 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77678

Bug ID: 77678
   Summary: ICE in fold_read_from_constant_string, at
fold-const.c:13706
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

A problem with default initialization (used for testing only),
starting at a specific negative value.
For versions down to at least 4.8, at -Og, -Os, -O1 or higher.
Testcode with an uninitialized variable "i" :


$ cat z1.f90
program p
   character(1) :: z
   integer :: i
   ! i = 2
   z = 'abc'(i:i)
   print *, z
end


$ gfortran-7-20160918 -O2 -finit-integer=-1 z1.f90
$ gfortran-7-20160918 -O2 -finit-integer=-890 z1.f90
$ gfortran-7-20160918 -O2 -finit-integer=-12345678 z1.f90
z1.f90:7:0:

 end

internal compiler error: Segmentation fault
0xc21a5f crash_signal
../../gcc/toplev.c:336
0x951f1b fold_read_from_constant_string(tree_node*)
../../gcc/fold-const.c:13706
0x996f7f fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
../../gcc/gimple-fold.c:5754
0x9984de fold_const_aggregate_ref(tree_node*)
../../gcc/gimple-fold.c:5857
0x9984de maybe_fold_reference
../../gcc/gimple-fold.c:281
0x998999 fold_gimple_assign
../../gcc/gimple-fold.c:313
0x99ddff fold_stmt_1
../../gcc/gimple-fold.c:3901
0xdc0781 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-propagate.c:
0x1299da2 dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:265
0xdbfb9b substitute_and_fold(tree_node* (*)(tree_node*), bool
(*)(gimple_stmt_iterator*), bool)
../../gcc/tree-ssa-propagate.c:1211
0xd299cc ccp_finalize
../../gcc/tree-ssa-ccp.c:949
0xd299cc do_ssa_ccp
../../gcc/tree-ssa-ccp.c:2415
0xd299cc execute
../../gcc/tree-ssa-ccp.c:2458

[Bug fortran/77678] ICE in fold_read_from_constant_string, at fold-const.c:13706

2016-09-21 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77678

--- Comment #1 from Gerhard Steinmetz  
---

Slightly modified :


$ cat z2.f90
program p
   character(3) :: c = 'abc'
   character(1) :: z
   integer :: i
   ! i = 2
   z = c(i:i)
   print *, z
end


$ gfortran-7-20160918 -O2 -finit-integer=-1 z2.f90
$ gfortran-7-20160918 -O2 -finit-integer=-890 z2.f90
$ gfortran-7-20160918 -O2 -finit-integer=-12345678 z2.f90
z2.f90:6:0:

z = c(i:i)

internal compiler error: Segmentation fault
0xc21a5f crash_signal
../../gcc/toplev.c:336
0x9053b7 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.c:10284
0x9077f8 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.c:9725
0x912cf6 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
../../gcc/expr.c:5547
0x9147d7 expand_assignment(tree_node*, tree_node*, bool)
../../gcc/expr.c:5167
0x802cb6 expand_gimple_stmt_1
../../gcc/cfgexpand.c:3649
0x802cb6 expand_gimple_stmt
../../gcc/cfgexpand.c:3745
0x8050ce expand_gimple_basic_block
../../gcc/cfgexpand.c:5752
0x80b276 execute
../../gcc/cfgexpand.c:6363

[Bug fortran/77679] New: ICE in fold_array_ctor_reference, at gimple-fold.c:5586

2016-09-21 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77679

Bug ID: 77679
   Summary: ICE in fold_array_ctor_reference, at
gimple-fold.c:5586
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Affects versions 6 and 7, at -Os, -O1 or higher.
Invalid code with an uninitialized variable.


$ cat z1.f90
program p
   character(1) :: x(2)
   x = [character(n(1)) :: 'a', 'b']
end


$ gfortran-7-20160918 -O0 z1.f90
z1.f90:3:0:

x = [character(n(1)) :: 'a', 'b']

Error: size of variable 'A.0' is too large


$ gfortran-7-20160918 -O2 z1.f90
z1.f90:4:0:

 end

internal compiler error: in fold_array_ctor_reference, at gimple-fold.c:5586
0x996e18 fold_array_ctor_reference
../../gcc/gimple-fold.c:5585
0x996e18 fold_ctor_reference(tree_node*, tree_node*, unsigned long, unsigned
long, tree_node*)
../../gcc/gimple-fold.c:5727
0x997055 fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
../../gcc/gimple-fold.c:5835
0x997eb0 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*),
tree_node* (*)(tree_node*))
../../gcc/gimple-fold.c:5297
0xe114bf record_temporary_equivalences_from_stmts_at_dest
../../gcc/tree-ssa-threadedge.c:329
0xe12351 thread_through_normal_block
../../gcc/tree-ssa-threadedge.c:1049
0xe13d21 thread_across_edge(gcond*, edge_def*, bool, const_and_copies*,
avail_exprs_stack*, tree_node* (*)(gimple*, gimple*, avail_exprs_stack*))
../../gcc/tree-ssa-threadedge.c:1289
0xd44c90 dom_opt_dom_walker::thread_across_edge(edge_def*)
../../gcc/tree-ssa-dom.c:989
0xd44ea9 dom_opt_dom_walker::after_dom_children(basic_block_def*)
../../gcc/tree-ssa-dom.c:1408
0x1299c37 dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:307
0xd47988 execute
../../gcc/tree-ssa-dom.c:614

[Bug target/77676] powerpc64 and powerpc64le stage2 bootstrap fail

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77676

--- Comment #10 from Martin Sebor  ---
Created attachment 39670
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39670&action=edit
Patch under test.

The patch should resolve all the issues discussed in this bug.  I don't have
access to Darwin so I'd appreciate your help validating it there.  The patch
doesn't enable the optimization yet.  I'm testing with it enabled and assuming
good results and no objections I'll re-enable it when I commit it.

[Bug fortran/77680] New: ICE in ctor_for_folding, at varpool.c:419

2016-09-21 Thread gerhard.steinmetz.fort...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77680

Bug ID: 77680
   Summary: ICE in ctor_for_folding, at varpool.c:419
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Another issue with default initialization (used for testing only).
Affects versions 5, 6 and 7, at -Og, -Os, -O1 or higher.


$ cat z1.f90
program p
   bind(c) :: x
   call s(x)
end


$ /home/gst/gcc/gcc-7-20160918-oyd/bin/gfortran -O2 -finit-real=zero -c z1.f90
z1.f90:4:0:

 end

internal compiler error: in ctor_for_folding, at varpool.c:419
0xf18192 ctor_for_folding(tree_node*)
../../gcc/varpool.c:419
0xdd4842 fully_constant_vn_reference_p(vn_reference_s*)
../../gcc/tree-ssa-sccvn.c:1377
0xdd998f vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool)
../../gcc/tree-ssa-sccvn.c:2431
0xddcec6 visit_reference_op_store
../../gcc/tree-ssa-sccvn.c:3583
0xddcec6 visit_use
../../gcc/tree-ssa-sccvn.c:3831
0xddeb6b process_scc
../../gcc/tree-ssa-sccvn.c:4073
0xddeb6b extract_and_process_scc_for_name
../../gcc/tree-ssa-sccvn.c:4160
0xddeb6b DFS
../../gcc/tree-ssa-sccvn.c:4212
0xddf3dd sccvn_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-sccvn.c:4678
0x1299da2 dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:265
0xde01f2 run_scc_vn(vn_lookup_kind)
../../gcc/tree-ssa-sccvn.c:4789
0xdb0b54 execute
../../gcc/tree-ssa-pre.c:5126

[Bug middle-end/49905] Better sanity checking on sprintf src & dest to produce warning for dodgy code ?

2016-09-21 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

David Binderman  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #20 from David Binderman  ---
(In reply to Martin Sebor from comment #19)
> Enhancement committed in r240298.

The current code seems to crash when given %lf specifier.

It might be better if it just ignored specifiers it doesn't know,
rather than crash. There are many (> 70) specifiers.

[Bug c/71501] missing warning on printf %s with a non-nul terminated string

2016-09-21 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71501
Bug 71501 depends on bug 49905, which changed state.

Bug 49905 Summary: Better sanity checking on sprintf src & dest to produce 
warning for dodgy code ?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

[Bug target/71395] PowerPC vec_init of 4 SFmode values could be improved on Power8

2016-09-21 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71395

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Michael Meissner  ---
Fixed in subversion id 240272.

[Bug target/71395] PowerPC vec_init of 4 SFmode values could be improved on Power8

2016-09-21 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71395

--- Comment #2 from Michael Meissner  ---
Author: meissner
Date: Wed Sep 21 20:17:32 2016
New Revision: 240332

URL: https://gcc.gnu.org/viewcvs?rev=240332&root=gcc&view=rev
Log:
Add PR target/71395 marker to 71395 fix

Modified:
trunk/gcc/ChangeLog

[Bug c++/77681] New: failing to inline simple function when using -fgnu-tm

2016-09-21 Thread pc at us dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77681

Bug ID: 77681
   Summary: failing to inline simple function when using -fgnu-tm
   Product: gcc
   Version: 6.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pc at us dot ibm.com
  Target Milestone: ---

Created attachment 39671
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39671&action=edit
testcase where always_inline fails with -fgnu-tm

I've used several different versions of GCC, including 4.8.5 and 6.2.1, on
different architectures (x86_64 and ppc64le).

I first noticed that a very simple "static inline" function was not being
inlined.  When I added "__attribute__((always_inline))", an error was produced
(see below). In narrowing down the testcase, I also tried to narrow down the
command line, and discovered that the error is only produced when "-fgnu-tm" is
present.  The narrowed-down testcase makes no use of transactional memory, so
there appears to be some inlining interference caused by "-fgnu-tm".
--
$ g++ -O3 -c always-inline.cpp -fgnu-tm -o /dev/null
always-inline.cpp: In member function ‘T* spsc::pop() [with T = int]’:
always-inline.cpp:9:1: error: inlining failed in call to always_inline ‘void*
_ZL13SPHGetFreePtrPv.constprop.0()’: 
 SPHGetFreePtr (void *H) {
 ^
always-inline.cpp:19:32: error: called from here
   T** p = (T**) SPHGetFreePtr(0);
$ g++ -O3 -c always-inline.cpp -o /dev/null
$
--

[Bug c/71501] missing warning on printf %s with a non-nul terminated string

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71501
Bug 71501 depends on bug 49905, which changed state.

Bug 49905 Summary: Better sanity checking on sprintf src & dest to produce 
warning for dodgy code ?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

[Bug middle-end/49905] Better sanity checking on sprintf src & dest to produce warning for dodgy code ?

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

Martin Sebor  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #21 from Martin Sebor  ---
I agree that the compiler shouldn't crash on directives it doesn't expect.

The feature is implemented at this point so let's open new bugs for problems in
the implementation (with the expected information such as a test case) rather
than reopening the enhancement request.

[Bug c/77682] New: GCC crashes while compiling OpenAL-Soft 1.17.2

2016-09-21 Thread jeffbai at aosc dot xyz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77682

Bug ID: 77682
   Summary: GCC crashes while compiling OpenAL-Soft 1.17.2
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jeffbai at aosc dot xyz
  Target Milestone: ---

GCC crashed while compiling openal-soft 1.17.2:

[ 82%] Building C object CMakeFiles/bsincgen.dir/utils/bsincgen.c.o
/bin/gcc  -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L
-D_XOPEN_SOURCE=500
-I/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/include
-I/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/build  -std=c11  -pipe
-Wno-error  -fstack-protector-strong --param=ssp-buffer-size=4   
-fomit-frame-pointer -O2-march=armv8-a -mtune=cortex-a53  
-fira-loop-pressure -fira-hoist-pressure -ftree-vectorize 
-specs=/usr/lib/autobuild3/specs/hardened-cc1  -O3 -DNDEBUG  
-Winline -Wall -Wextra -fvisibility=hidden -pthread -o
CMakeFiles/bsincgen.dir/utils/bsincgen.c.o   -c
/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/utils/bsincgen.c
/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/utils/bsincgen.c: In
function ‘main’:
/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/utils/bsincgen.c:160:13:
internal compiler error: Segmentation fault
 int m = 2 * (int)floor(a);
 ^
gcc: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[2]: *** [CMakeFiles/bsincgen.dir/build.make:63:
CMakeFiles/bsincgen.dir/utils/bsincgen.c.o] Error 4
make[2]: *** Deleting file 'CMakeFiles/bsincgen.dir/utils/bsincgen.c.o'
make[2]: Leaving directory
'/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/build'
make[1]: *** [CMakeFiles/Makefile2:223: CMakeFiles/bsincgen.dir/all] Error 2
make[1]: Leaving directory
'/var/lib/abbs/build/tmp.cUeDFpnWuA/openal-soft-1.17.2/build'
make: *** [Makefile:128: all] Error 2

GCC version info:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-aosc-linux-gnu/6.2.0/lto-wrapper
Target: aarch64-aosc-linux-gnu
Configured with: /var/lib/abbs/build/tmp.oCDM81AKGq/gcc-6.2.0/configure
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=https://github.com/AOSC-Dev/aosc-os-core
--enable-languages=c,c++,fortran,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-gnu-indirect-function
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --with-isl=/usr --enable-lto --enable-plugin
--enable-install-libiberty --disable-multilib --disable-werror --enable-pie
--enable-checking=release --with-default-libstdcxx-abi=gcc4-compatible
--build=aarch64-aosc-linux-gnu --with-linker-hash-style=gnu --disable-altivec
--disable-fixed-point --with-arch=armv8-a
Thread model: posix
gcc version 6.2.0 20160822 (AOSC OS, Core) (GCC)

openal-soft source:
http://kcat.strangesoft.net/openal-releases/openal-soft-1.17.2.tar.bz2

[Bug middle-end/77683] New: ICE on %lf directive in format_floating in /src/gcc-svn/gcc/gimple-ssa-sprintf.c:1163

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77683

Bug ID: 77683
   Summary: ICE on %lf directive in format_floating in
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:1163
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

The gimple-ssa-sprintf.c pass crashes on a %lf directive:

$ cat v.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S -Wall
-Wformat -Wextra -Wpedantic v.c
char d [3];

void f (double x)
{
  __builtin_sprintf (d, "%lf", x);
}
v.c: In function ‘f’:
v.c:3:6: internal compiler error: in format_floating, at
gimple-ssa-sprintf.c:1163
 void f (double x)
  ^
0x181ba7e format_floating
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:1163
0x181c8b2 format_floating
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:1373
0x181d144 format_directive
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:1626
0x181e794 compute_format_length
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:2320
0x181f516 handle_gimple_call
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:2645
0x181f5f1 execute
/src/gcc-svn/gcc/gimple-ssa-sprintf.c:2671
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug middle-end/49905] Better sanity checking on sprintf src & dest to produce warning for dodgy code ?

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49905

--- Comment #22 from Martin Sebor  ---
I've raised bug 77683 for the ICE on %lf.

[Bug c++/77681] failing to inline simple function when using -fgnu-tm

2016-09-21 Thread pc at us dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77681

--- Comment #1 from Paul Clarke  ---
shoot. this may be a dup of bug 53991

[Bug tree-optimization/53991] _mm_popcnt_u64 fails with -O3 -fgnu-tm

2016-09-21 Thread pc at us dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53991

Paul Clarke  changed:

   What|Removed |Added

 CC||pc at us dot ibm.com

--- Comment #10 from Paul Clarke  ---
*** Bug 77681 has been marked as a duplicate of this bug. ***

[Bug c++/77681] failing to inline simple function when using -fgnu-tm

2016-09-21 Thread pc at us dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77681

Paul Clarke  changed:

   What|Removed |Added

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

--- Comment #2 from Paul Clarke  ---
I'll move over to the already-reported bug.

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

[Bug middle-end/77683] ICE on %lf directive in format_floating in gimple-ssa-sprintf.c:1163

2016-09-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77683

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-09-21
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
Summary|ICE on %lf directive in |ICE on %lf directive in
   |format_floating in  |format_floating in
   |/src/gcc-svn/gcc/gimple-ssa |gimple-ssa-sprintf.c:1163
   |-sprintf.c:1163 |
 Ever confirmed|0   |1
  Known to fail||7.0

  1   2   >