[Bug tree-optimization/84817] New: PR tree-optimization/84526: gcc-8-8-20180310-1 FTBFS on GNU/Hurd by removing "dead" code

2018-03-11 Thread svante.signell at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84817

Bug ID: 84817
   Summary: PR tree-optimization/84526: gcc-8-8-20180310-1 FTBFS
on GNU/Hurd by removing "dead" code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: svante.signell at gmail dot com
  Target Milestone: ---

Hi,

Latest Debian version of gcc-8: gcc-8-8-20180310-1 (r258410) FTBFS due to
gimple-match.c problems:

build/genmatch --gimple ../../src/gcc/match.pd \
> tmp-gimple-match.c
GIMPLE decision tree has 2511 leafs, maximum depth 12 and a total number of
9849 nodes
removed 1569 duplicate tails
build/genmatch --generic ../../src/gcc/match.pd \
> tmp-generic-match.c
GENERIC decision tree has 2461 leafs, maximum depth 12 and a total number of
9612 nodes
removed 1530 duplicate tails
/bin/bash ../../src/gcc/../move-if-change tmp-gimple-match.c \
gimple-match.c
/bin/bash ../../src/gcc/../move-if-change tmp-generic-match.c \
generic-match.c
echo timestamp > s-match
/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/./prev-gcc/xg++
-B/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/./prev-gcc/
-B/usr/i686-gnu/bin/ -nostdinc++
-B/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/src/.libs
-B/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/libsupc++/.libs

-I/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/include/i686-gnu

-I/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/include
 -I/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/src/libstdc++-v3/libsupc++
-L/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/src/.libs
-L/home/srs/DEBs/gcc-8/gcc-8-8-20180310-1.1/build/prev-i686-gnu/libstdc++-v3/libsupc++/.libs
-fno-PIE -c   -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  -Wno-unused
-DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/.
-I../../src/gcc/../include -I../../src/gcc/../libcpp/include 
-I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/bid
-I../libdecnumber -I../../src/gcc/../libbacktrace   -o gimple-match.o -MT
gimple-match.o -MMD -MP -MF ./.deps/gimple-match.TPo gimple-match.c
gimple-match.c: In function 'bool gimple_simplify_FLOAT_EXPR(code_helper*,
tree_node**, gimple**, tree_node* (*)(tree), code_helper, tree, tree)':
gimple-match.c:15146:1: error: unable to find a register to spill
 }
 ^
gimple-match.c:15146:1: error: this is the insn:
(insn 616 3197 2728 97 (parallel [
(set (reg:DI 938 [547])
(ashift:DI (reg:DI 938 [547])
(reg:QI 1367)))
(clobber (reg:CC 17 flags))
]) "../../src/gcc/hwint.h":293 431 {*ashldi3_doubleword}
 (expr_list:REG_DEAD (reg:QI 1367)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil
gimple-match.c:15146: confused by earlier errors, bailing out

Looking at src/gcc/Changelog one finds:

2018-03-09  Martin Sebor  

PR tree-optimization/84526
* gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
Remove dead code.

Replacing the file src/gcc/gimple-ssa-warn-restrict.c with an older version of
that file from gcc-8: gcc-8-8-20180308-1 (r258348) makes the build successful
again.

Can you please revert the changes that breaks the build?

Thanks!

[Bug fortran/32770] [Meta-bug] -fdefault-integer-8 issues

2018-03-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32770

--- Comment #38 from Dominique d'Humieres  ---
Created attachment 43622
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43622&action=edit
Changes in gfortran.dg/coarray to fix some failures with -fdefault-integer-8

[Bug fortran/32770] [Meta-bug] -fdefault-integer-8 issues

2018-03-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32770

--- Comment #39 from Dominique d'Humieres  ---
Created attachment 43623
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43623&action=edit
Changes in gfortran.dg/ieee to fix some failures with -fdefault-integer-8

[Bug fortran/32770] [Meta-bug] -fdefault-integer-8 issues

2018-03-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32770

--- Comment #40 from Dominique d'Humieres  ---
Created attachment 43624
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43624&action=edit
Changes in gfortran.dg to fix some failures with -fdefault-integer-8

With the three attached patches the number of unexpected failures with -m64 is
down to 469.

[Bug c++/61982] Optimizer does not eliminate stores to destroyed objects

2018-03-11 Thread a...@cloudius-systems.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61982

--- Comment #8 from Avi Kivity  ---
Still unfixed in trunk.

[Bug target/84475] pthread doesn't define _REENTRANT in preprocessor on riscv-linux

2018-03-11 Thread aurelien at aurel32 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84475

Aurelien Jarno  changed:

   What|Removed |Added

 CC||aurelien at aurel32 dot net

--- Comment #4 from Aurelien Jarno  ---
(In reply to Jonathan Wakely from comment #1)
> Does it need to define it?

Some software, like libmicrohttpd, check in there configure script if
_REENTRANT is correctly defined. This might be wrong, but I guess riscv-linux
should just behave like other platforms.

Could someone with commit rights please backport this to the gcc 7 branch?

[Bug tree-optimization/84817] PR tree-optimization/84526: gcc-8-8-20180310-1 FTBFS on GNU/Hurd by removing "dead" code

2018-03-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84817

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-03-11
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
Please try GCC trunk after r258415.

[Bug other/37210] Discourage Default Builds in the GCC Source Tree more strongly

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37210

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
Summary|Prohibit Default Builds in  |Discourage Default Builds
   |the GCC Source Tree |in the GCC Source Tree more
   ||strongly

--- Comment #6 from Eric Gallager  ---
I'm going to confirm this with a slightly modified title

[Bug target/83984] ld: The value 0x8000000000005 does not fit when applying the relocation DIR21L

2018-03-11 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83984

--- Comment #3 from John David Anglin  ---
Author: danglin
Date: Sun Mar 11 14:43:39 2018
New Revision: 258432

URL: https://gcc.gnu.org/viewcvs?rev=258432&root=gcc&view=rev
Log:
Backport from mainline
2018-02-14  John David Anglin  

PR target/83984
* config/pa/pa.md: Load address of PIC label using the linkage table
if the label is nonlocal.


Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/pa/pa.md

[Bug target/83984] ld: The value 0x8000000000005 does not fit when applying the relocation DIR21L

2018-03-11 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83984

--- Comment #4 from John David Anglin  ---
Author: danglin
Date: Sun Mar 11 14:44:48 2018
New Revision: 258433

URL: https://gcc.gnu.org/viewcvs?rev=258433&root=gcc&view=rev
Log:
Backport from mainline
2018-02-14  John David Anglin  

PR target/83984
* config/pa/pa.md: Load address of PIC label using the linkage table
if the label is nonlocal.


Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/pa/pa.md

[Bug fortran/84615] [8 Regression] Executable Segfault for some tests compiled with -m32 after r256284

2018-03-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84615

--- Comment #8 from Dominique d'Humieres  ---
Another test that does not require -fdefault-integer-8

module chtest
contains
  function chararray2string(chararray) result(text)
character(len=1), dimension(:) :: chararray! input
character(len=int(size(chararray, 1), kind=8)) :: text  ! output
print *, ">", chararray, "<"
do i = 1,size(chararray,1)
  text(i:i) = chararray (i)
end do
print *, ">", text, "<"
  end function chararray2string
end module chtest
program TestStringTools
  use chtest
  character(len=52)   :: txt
  character(len=1), dimension(52) :: chararr = &
(/(char(i+64),char(i+96), i = 1,26)/)
  print *, ">", chararr, "<"
  txt = chararray2string(chararr)
  if (txt .ne. "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz") &
STOP 1
end program TestStringTools

[Bug target/79644] Undocumented options in microblaze.opt

2018-03-11 Thread roland.illig at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79644

Roland Illig  changed:

   What|Removed |Added

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

--- Comment #1 from Roland Illig  ---
Unfixed since 2010.

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

[Bug target/47105] Some mxl-options have only placeholders as descriptions

2018-03-11 Thread roland.illig at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47105

Roland Illig  changed:

   What|Removed |Added

 CC||roland.illig at gmx dot de

--- Comment #1 from Roland Illig  ---
*** Bug 79644 has been marked as a duplicate of this bug. ***

[Bug debug/58150] debug info about definition of enum class not emitted if the declaration was already used in a class

2018-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58150

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Sun Mar 11 16:50:08 2018
New Revision: 258434

URL: https://gcc.gnu.org/viewcvs?rev=258434&root=gcc&view=rev
Log:
PR debug/58150
* dwarf2out.c (gen_enumeration_type_die): Don't guard adding
DW_AT_declaration for ENUM_IS_OPAQUE on -gdwarf-4 or -gno-strict-dwarf,
but on TYPE_SIZE.  Don't do anything for ENUM_IS_OPAQUE if not creating
a new die.  Don't set TREE_ASM_WRITTEN if ENUM_IS_OPAQUE.  Guard
addition of most attributes on !orig_type_die or the attribute not
being present already.  Assert TYPE_VALUES is NULL for ENUM_IS_OPAQUE.

* g++.dg/debug/dwarf2/enum2.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/enum2.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug c/84818] New: integer_onep must not be used for i18n

2018-03-11 Thread roland.illig at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84818

Bug ID: 84818
   Summary: integer_onep must not be used for i18n
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: roland.illig at gmx dot de
  Target Milestone: ---

In English, the following idiom is correct:

warning_at (loc, opt,
(integer_onep (range[0])
 ? G_("%K%qD writing %E byte into a region "
  "of size %E overflows the destination")
 : G_("%K%qD writing %E bytes into a region "
  "of size %E overflows the destination")),

In other languages, this fails.

- In French, 0 and 1 both use the singular.
- In Polish, Arabic and several other languages there are up to 6 plural forms.

See
http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html

[Bug fortran/84070] Incorrect assignment to allocatable character variable

2018-03-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84070

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|WAITING |RESOLVED
 CC||kargl at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |7.4

--- Comment #2 from kargl at gcc dot gnu.org ---
This is fixed on 7-branch and trunk.
Closing.

[Bug debug/58150] debug info about definition of enum class not emitted if the declaration was already used in a class

2018-03-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58150

--- Comment #6 from Jakub Jelinek  ---
Fixed for 8.1+.

[Bug c/84819] New: several typos

2018-03-11 Thread roland.illig at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84819

Bug ID: 84819
   Summary: several typos
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: roland.illig at gmx dot de
  Target Milestone: ---

While translating gcc-8.1-b20180128 into German, I discovered the following
typos:

switch statements, which use 

=> "statements, which" should be replaced with "statements that"

what to coverage sanitize

=> I have no idea what this should mean

Cotrol-Flow

=> Control-Flow

" stored in the current "

=> The space at the end of the line should be removed. This is a general
consistency problem; it would be good if such string literals would never get
committed in the first place.

[Bug c++/84816] [7.2.0/8.0.1 x86_64] Incorrect code generation if signed overflow

2018-03-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84816

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #8 from Eric Botcazou  ---
> Yes, but code generation incorrect. It's not runtime yet.

The criterion is as follows: does the code invoke undefined behavior when
executed in the abstract machine specified by the C standard?  If so, then the
compiler is allowed to generate object code that does anything, including
playing some music or erasing the hard drive; here it generates an infinite
loop and that's OK.

[Bug c++/84820] New: [6/7/8 Regression] Bogus pointer-to-member accepted within template

2018-03-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84820

Bug ID: 84820
   Summary: [6/7/8 Regression]  Bogus pointer-to-member accepted
within template
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: accepts-invalid
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet is wrongly accepted since GCC 4.9.0:


struct A {};

template struct B : A
{
  B()
  {
A(&A::foo);
  }
};

B<0> b;


Before, the code was correctly rejected:

bug.cc: In constructor 'B< >::B()':
bug.cc:7:14: error: invalid use of qualified-name 'A::foo'
 A(&A::foo);
  ^

[Bug other/84821] New: [8 Regression] ICE (unable to find a register to spill)

2018-03-11 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84821

Bug ID: 84821
   Summary: [8 Regression] ICE (unable to find a register to
spill)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

r258410, when doing a jit build using a r258410 bootstrapped compiler.

the bootstrap build is configured with
configure -v --with-pkgversion='Ubuntu 8-20180310-1ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-8
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu

the jit build is configured with the same arguments plus --enable-host-shared.

with options \" '-v' '--with-pkgversion=Ubuntu 8-20180310-1ubuntu1'
'--with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs' '--prefix=/usr'
'--with-gcc-major-version-only' '--program-suffix=-8'
'--program-prefix=x86_64-linux-gnu-' '--enable-shared'
'--enable-linker-build-id' '--libexecdir=/usr/lib' '--without-included-gettext'
'--enable-threads=posix' '--libdir=/usr/lib' '--enable-nls' '--with-sysroot=/'
'--enable-clocale=gnu' '--enable-libstdcxx-time=yes'
'--with-default-libstdcxx-abi=new' '--enable-gnu-unique-object'
'--disable-vtable-verify' '--enable-libmpx' '--enable-plugin'
'--enable-default-pie' '--with-system-zlib' '--with-target-system-zlib'
'--enable-objc-gc=auto' '--enable-multiarch' '--disable-werror'
'--with-arch-32=i686' '--with-abi=m64' '--with-multilib-list=m32,m64,mx32'
'--enable-multilib' '--with-tune=generic' '--enable-offload-targets=nvptx-none'
'--without-cuda-driver' '--enable-checking=release' '--build=x86_64-linux-gnu'
'--host=x86_64-linux-gnu' '--target=x86_64-linux-gnu' '--enable-host-shared'
'--disable-bootstrap' 'build_alias=x86_64-linux-gnu'
'host_alias=x86_64-linux-gnu' 'target_alias=x86_64-linux-gnu'
'CC=/home/packages/gcc/8/u/gcc-8-8-20180310/build/gcc/xgcc
-B/home/packages/gcc/8/u/gcc-8-8-20180310/build/gcc/'
'CXX=/home/packages/gcc/8/u/gcc-8-8-20180310/build/gcc/xg++
-B/home/packages/gcc/8/u/gcc-8-8-20180310/build/gcc/
-B/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libatomic/.libs
-B/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/src/.libs
-B/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/include
-I/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/include/x86_64-linux-gnu
-I/home/packages/gcc/8/u/gcc-8-8-20180310/src/libstdc++-v3/libsupc++
-L/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libatomic/.libs
-L/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/src/.libs
-L/home/packages/gcc/8/u/gcc-8-8-20180310/build/x86_64-linux-gnu/libstdc++-v3/libsupc++/.libs'
'--enable-languages=c,c++,jit,lto'\"

$ build/gcc/xg++ -Bbuild/gcc/ -O2 -fPIC ira-lives.ii 
ira-lives.ii: In function 'void fn3()':
ira-lives.ii:51:1: error: unable to find a register to spill
 }
 ^
ira-lives.ii:51:1: error: this is the insn:
(insn 91 263 258 14 (parallel [
(set (reg:SI 198 [145])
(lshiftrt:SI (reg:SI 198 [145])
(reg:QI 202)))
(clobber (reg:CC 17 flags))
]) "ira-lives.ii":43 577 {*lshrsi3_1}
 (expr_list:REG_DEAD (reg:QI 202)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil
ira-lives.ii:51: confused by earlier errors, bailing out

not seen with -O1. and it looks like the configury needs to be done with
--enable-default-pie to reproduce the issue.

$ cat ira-lives.ii
typedef struct a *b;
struct a {
  int c;
  unsigned d[];
};
int e, f, g, i, l, m;
struct o {
  long *h;
  int c;
  unsigned j;
  int k;
  long aa;
};
inline void p(o *r) { r->c = g; }
int *n, *ab;
inline bool s(o *r) {
  for (; r->aa == 0; r->aa = r->h[r->j])
if (r->j >= r->c)
  return false;
  r->aa >>= 1;
  for (; r->aa;)
r++;
  *n = r->k;
  return true;
}
class t {
public:
  t(int);

[Bug lto/43659] -flto doesn't remember -fPIC

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43659

Eric Gallager  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #5 from Eric Gallager  ---
(In reply to Jan Hubicka from comment #4)
> This was fixed on mainline by patch of mine
> http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00210.html
> perhaps it can be backported.

Any of the branches this might have been backported to are now closed; closing
this bug as FIXED then.

[Bug c/84819] several typos

2018-03-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84819

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-03-11
 CC||marxin at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug fortran/83939] Constraint C1290 (elemental function cannot be allocatable) not enforced

2018-03-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83939

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
I have a patch.

[Bug fortran/66128] ICE for some intrinsics with zero sized array parameter

2018-03-11 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66128

--- Comment #18 from Thomas Koenig  ---
Author: tkoenig
Date: Sun Mar 11 20:28:00 2018
New Revision: 258435

URL: https://gcc.gnu.org/viewcvs?rev=258435&root=gcc&view=rev
Log:
2018-03-11  Thomas Koenig  

PR fortran/66128
* simplify.c (simplify_transformation): Return default result for
empty array argument.
(gfc_simplify_all): Remove special-case handling for zerosize.
(gfc_simplify_any): Likewise.
(gfc_simplify_count): Likewise.
(gfc_simplify_iall): Likewise.
(gfc_simplify_iany): Likewise.
(gfc_simplify_iparity): Likewise.
(gfc_simplify_minval): Likewise.
(gfc_simplify_maxval): Likewise.
(gfc_simplify_norm2): Likewise.
(gfc_simplify_product): Likewise.
(gfc_simplify_sum): Likewise.

2018-03-11  Thomas Koenig  

PR fortran/66128
* gfortran.dg/zero_sized_9.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/zero_sized_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog

[Bug other/84821] [8 Regression] ICE (unable to find a register to spill)

2018-03-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84821

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-03-11
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
Please try GCC trunk after r258415.

[Bug fortran/66128] ICE for some intrinsics with zero sized array parameter

2018-03-11 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66128

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #19 from Thomas Koenig  ---
Fixed, closing.

[Bug c++/84822] New: Partial specializing template internal compiler error

2018-03-11 Thread feiteng at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84822

Bug ID: 84822
   Summary: Partial specializing template internal compiler
error
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: feiteng at gmail dot com
  Target Milestone: ---

Created attachment 43625
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43625&action=edit
the preprocessed file (*.i*) that triggers the bug

When partially specializing template with more than one auto non-type
template parameters, a mixed usage of auto non-type template argument and named
non-type template argument causes ICE. 
Example code 
https://godbolt.org/g/3GebP8 
contains several variants of the error.

g++ (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0

g++ partialspecializationbug.cpp -std=c++17

partialspecializationbug.cpp:72:34: internal compiler error: Segmentation fault
 Listener<&Foo::evt, &Bar::f> conn;
  ^~~~
0xae558f crash_signal
../../src/gcc/toplev.c:337
0x5e187a unify
../../src/gcc/cp/pt.c:20513
0x5e1680 unify
../../src/gcc/cp/pt.c:21006
0x5f36e1 unify_one_argument
../../src/gcc/cp/pt.c:19128
0x5f8726 type_unification_real
../../src/gcc/cp/pt.c:19248
0x5e0313 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../src/gcc/cp/pt.c:25537
0x5e1f5d unify
../../src/gcc/cp/pt.c:20662
0x5e1508 unify
../../src/gcc/cp/pt.c:20851
0x5e2991 get_partial_spec_bindings
../../src/gcc/cp/pt.c:21648
0x5e2d1d most_specialized_partial_spec
../../src/gcc/cp/pt.c:21919
0x5fe4db instantiate_class_template_1
../../src/gcc/cp/pt.c:10312
0x5fe4db instantiate_class_template(tree_node*)
../../src/gcc/cp/pt.c:10880
0x662305 complete_type(tree_node*)
../../src/gcc/cp/typeck.c:133
0x5cea01 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
../../src/gcc/cp/decl.c:12043
0x61e302 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../src/gcc/cp/decl2.c:806
0x63343b cp_parser_member_declaration
../../src/gcc/cp/parser.c:23419
0x633e0a cp_parser_member_specification_opt
../../src/gcc/cp/parser.c:22968
0x633e0a cp_parser_class_specifier_1
../../src/gcc/cp/parser.c:22121
0x635a61 cp_parser_class_specifier
../../src/gcc/cp/parser.c:22373
0x635a61 cp_parser_type_specifier
../../src/gcc/cp/parser.c:16446

[Bug fortran/30372] various intrinsics do not diagnose invalid argument kinds

2018-03-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30372

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org

[Bug fortran/30372] various intrinsics do not diagnose invalid argument kinds

2018-03-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30372

--- Comment #9 from kargl at gcc dot gnu.org ---
KILL has been at least reviewed for correctness.  See

r258436 | kargl | 2018-03-11 14:34:40 -0700 (Sun, 11 Mar 2018) | 14 lines

2018-03-11  Steven G. Kargl  

* check.c (gfc_check_kill):  Check pid and sig are scalar.
(gfc_check_kill_sub): Restrict kind to 4 and 8.
* intrinsic.c (add_function): Sort keyword list.  Add pid and sig
keywords for KILL.  Remove redundant *back="back" in favor of the
original *bck="back".
(add_subroutines): Sort keyword list.  Add pid and sig keywords
for KILL.
* intrinsic.texi: Fix documentation to consistently use pid and sig.
* iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
correct function.
(gfc_resolve_rename_sub): Add comment.

[Bug fortran/83939] Constraint C1290 (elemental function cannot be allocatable) not enforced

2018-03-11 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83939

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Mar 11 21:39:15 2018
New Revision: 258437

URL: https://gcc.gnu.org/viewcvs?rev=258437&root=gcc&view=rev
Log:
2018-03-11  Steven G. Kargl  

PR fortran/83939
* resolve.c (resolve_fl_procedure): Enforce F2018:C15100.

2018-03-11  Steven G. Kargl  

PR fortran/83939
* gfortran.dg/pr83939.f90

Added:
trunk/gcc/testsuite/gfortran.dg/pr83939.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/84780] [8 Regression] wrong code aarch64 with -O3 --param=tree-reassoc-width=32

2018-03-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84780

--- Comment #7 from Segher Boessenkool  ---
I have a patch.

[Bug fortran/81849] Size of automatic array argument specified by host-associated variable.

2018-03-11 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81849

Harald Anlauf  changed:

   What|Removed |Added

 CC||anlauf at gmx dot de

--- Comment #2 from Harald Anlauf  ---
The problem is associated with the result clause.  The following works:

  program p
implicit none
integer  :: n=3
print *, f()
  contains
function f()
  real:: f(n)
  f = 7
end function
  end program

[Bug fortran/84546] [7/8 Regression] Bad sourced allocation of CLASS(*) with source with CLASS(*) component

2018-03-11 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84546

--- Comment #5 from Paul Thomas  ---
Author: pault
Date: Sun Mar 11 22:25:11 2018
New Revision: 258438

URL: https://gcc.gnu.org/viewcvs?rev=258438&root=gcc&view=rev
Log:
2018-03-11  Paul Thomas  

PR fortran/84546
* trans-array.c (structure_alloc_comps): Make sure that the
vptr is copied and that the unlimited polymorphic _len is used
to compute the size to be allocated.
* trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
unlimited polymorphic _len for the offset to the element.
(gfc_copy_class_to_class): Set the new 'unlimited' argument.
* trans.h : Add the boolean 'unlimited' to the prototype.

2018-03-11  Paul Thomas  

PR fortran/84546
* gfortran.dg/unlimited_polymorphic_29.f90 : New test.


Added:
trunk/gcc/testsuite/gfortran.dg/unlimited_polymorphic_29.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans.h
trunk/gcc/testsuite/ChangeLog

[Bug fortran/84546] [7/8 Regression] Bad sourced allocation of CLASS(*) with source with CLASS(*) component

2018-03-11 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84546

--- Comment #6 from Neil Carlson  ---
Thank you, thank you Paul!

This also fixes my test case for PR83118 which I think must have been due to
the same underlying problem

[Bug middle-end/84823] New: [6 Regression?] x86 LRA hang on valid code (no ICE) with -fno-omit-frame-pointer

2018-03-11 Thread awilfox at adelielinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84823

Bug ID: 84823
   Summary: [6 Regression?] x86 LRA hang on valid code (no ICE)
with -fno-omit-frame-pointer
   Product: gcc
   Version: 6.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: awilfox at adelielinux dot org
  Target Milestone: ---

Created attachment 43626
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43626&action=edit
preprocessed source that fails

Environment:
Adélie Linux 1.0-alpha5
Intel(R) Pentium(R) 4 CPU 2.40GHz [15/2/9; HT enabled]
gcc (Adelie 6.4.0) 6.4.0
musl libc 1.1.19


Scenario:
Compiling WINE 3.0 for the x86 architecture of Adélie on our builder.  Target
arch is Pentium MMX.


Actual result:
cc1 hung for almost 16 hours while compiling ntdll/server.c.  Trying again with
-fchecking -Q made no difference; three hours later, no ICE was generated. 
Output was:

 __FLOAT_BITS __DOUBLE_BITS __islessf __isless __islessl __islessequalf
__islessequal __islessequall __islessgreaterf __islessgreater __islessgreaterl
__isgreaterf __isgreater __isgreaterl __isgreaterequalf __isgreaterequal
__isgreaterequall __bswap16 __bswap32 __bswap64 __fortify_FD_CLR
__fortify_FD_SET bcopy bzero memcpy memmove memset stpcpy stpncpy strcat strcpy
strncat strncpy mempcpy strlcat strlcpy realpath confstr getcwd getdomainname
getgroups gethostname getlogin_r pread read readlink readlinkat ttyname_r write
memcpy_unaligned interlocked_cmpxchg interlocked_cmpxchg_ptr interlocked_xchg
interlocked_xchg_ptr interlocked_xchg_add interlocked_cmpxchg64 __isspace fgets
fread fwrite vsnprintf vsprintf snprintf sprintf recv recvfrom send sendto
NtCurrentTeb RtlSecureZeroMemory HRESULT_FROM_WIN32 lstrcpynW lstrcpynA
lstrlenW lstrlenA lstrcpyW lstrcpyA lstrcatW lstrcatA
InterlockedCompareExchangePointer InterlockedExchangePointer GetLastError
GetCurrentProcessId GetCurrentThreadId SetLastError GetProcessHeap
wine_ldt_set_base wine_ldt_set_limit wine_ldt_get_base wine_ldt_get_limit
wine_ldt_set_flags wine_ldt_get_flags wine_ldt_is_empty wine_get_cs wine_get_ds
wine_get_es wine_get_fs wine_get_gs wine_get_ss wine_set_fs wine_set_gs
DbgBreakPoint DbgUserBreakPoint RtlCheckBit RtlUshortByteSwap RtlUlongByteSwap
RemoveHeadList RemoveTailList get_vm86_teb_info wine_server_call_err
wine_server_reply_size wine_server_add_data wine_server_set_reply
wine_server_obj_handle wine_server_user_handle wine_server_ptr_handle
wine_server_client_ptr wine_server_get_ptr wine_dbgstr_a wine_dbgstr_w
wine_dbgstr_guid wine_dbgstr_point wine_dbgstr_rect wine_dbgstr_longlong
debugstr_an debugstr_wn debugstr_guid debugstr_a debugstr_w __CPU_AND_S
__CPU_OR_S __CPU_XOR_S ntdll_get_thread_data interlocked_xchg64 fatal_error
fatal_perror server_protocol_error server_protocol_perror send_request
read_reply_data wait_reply server_call_unlocked wine_server_call
server_enter_uninterrupted_section server_leave_uninterrupted_section
wait_select_reply invoke_apc server_select server_queue_process_apc
wine_server_send_fd receive_fd handle_to_index add_fd_to_cache get_cached_fd
server_remove_fd_from_cache server_get_unix_fd wine_server_fd_to_handle
wine_server_handle_to_fd wine_server_release_fd server_pipe start_server
setup_config_dir server_connect_error server_connect get_unix_tid
server_init_process server_init_process_done server_init_thread
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data>   

 
Assembling functions:
  server_protocol_error server_protocol_perror read_reply_data
wait_select_reply invoke_apc receive_fd add_fd_to_cache fatal_perror
fatal_error start_server server_connect server_call_unlocked wine_server_call
server_enter_uninterrupted_section server_leave_uninterrupted_section
server_select server_queue_process_apc wine_server_send_fd
server_remove_fd_from_cache server_get_unix_fd


Expected result:
Compilation of ntdll/server.c translation unit.


CFLAGS in use at the time (incl. WINE package defaults and Adélie overrides):

gcc -c -o server.o server.c -I. -I../../include -D__WINESRC__ -D_NTSYSTEM_
-D_REENTRANT -fPIC -Wall   -pipe -fno-strict-aliasing
-Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers  
-Wn-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits  
-Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op
-gdwarf-2   -gstrict-dwarf -fno-omit-frame-pointer -O2 -march=pentium-mmx
-mtune=pentium-m -fno-omit-frame-pointer -g -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=0


If -fno-omit-frame-pointer is removed, compilation succeeds.  If -O2 is
replaced with -O0, compilation succeeds.  It feels like a rehash of 55396 but
that was solved back in the 4.x days.  I will note that when we built WINE 2.x
last year with GCC 5.3.0 this issue did not occur, and -fno-omit-frame-pointer
was active then; hence,

[Bug debug/23551] dwarf records for inlines appear incomplete

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23551

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #20 from Eric Gallager  ---
(In reply to Matthew Fortune from comment #19)
> I have one further case that may be worth adding to this ticket which
> relates to the order of formal paramters emitted for an inlined subroutine
> in debug info.
> 
> GCC currently emits formal parameter DIEs for an inlined subroutine in
> reverse order to the function's parameters. The DWARF spec is slightly
> unclear in this area but does indicate that formal parameters must appear in
> the same order as listed in the function prototype in both abstract and
> concrete instances.
> 
> One potential fix would be to change setup_one_parameter in tree-inline.c to
> append each new VAR_DECL to the vars list instead of prepend them. There may
> however be a more elegant approach by modifying the dwarf engine to detect
> and re-order VAR_DECLs that relate to formal paramters and emit them in the
> correct order.
> 
> If this would be best as a separate ticket then I will open one.

If a separate ticket would let us close this one, then yes, please open one.

[Bug c++/33979] support for char16_t, char32_t

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33979

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #19 from Eric Gallager  ---
(In reply to Scott A. Colcord from comment #18)
> Should the library support for this be split into a separate bug?  Or two
> bugs, if libstdc++ and glibc both need to handle the new types?

I'd want to get an update on whether it's still needed first, or whether it's
already been added. If it's still needed, then it'd make sense for a separate
libstdc++ bug on this bugzilla (glibc has its own separate bugzilla)

[Bug target/47315] ICE: in extract_insn, at recog.c:2109 (unrecognizable insn) with -mvzeroupper and __attribute__((target("avx")))

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47315

Eric Gallager  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #6 from Eric Gallager  ---
(In reply to H.J. Lu from comment #5)
> (In reply to comment #4)
> > (In reply to comment #2)
> > > A patch is posted at
> > > 
> > > http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01649.html
> > 
> > H.J., Since this bug shows up in gcc 4.6, could you backport to gcc 4.6
> > branch? Thanks,
> > 
> 
> I have no plan to backport. Please feel free to backport.

Since gcc 4.6 branch is closed, there's no more need to backport, so I'm going
to assume that this:

(In reply to h...@gcc.gnu.org from comment #3)
> Author: hjl
> Date: Mon May 23 16:51:42 2011
> New Revision: 174078
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174078
> Log:
> Save the initial options after checking vzeroupper.
> 
> gcc/
> 
> 2011-05-23  H.J. Lu  
> 
>   PR target/47315
>   * config/i386/i386.c (ix86_option_override_internal): Save the
>   initial options after checking vzeroupper.
> 
> gcc/testsuite/
> 
> 2011-05-23  H.J. Lu  
> 
>   PR target/47315
>   * gcc.target/i386/pr47315.c: New test.
> 
> Added:
> trunk/gcc/testsuite/gcc.target/i386/pr47315.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/config/i386/i386.c
> trunk/gcc/testsuite/ChangeLog

fixed it.

[Bug preprocessor/48957] GCC's handling of include-fixed does not work well with --sysroot

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48957

Eric Gallager  changed:

   What|Removed |Added

   Keywords||build
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-12
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Gallager  ---
(In reply to jos...@codesourcery.com from comment #1)
> On Wed, 11 May 2011, psmith at gnu dot org wrote:
> 
> > I think that the include-fixed directory should be associated with the 
> > sysroot,
> 
> It should be associated with each system include directory (sysroot or 
> otherwise) - so there should be a fixed version of /usr/local/include, 
> searched immediately before /usr/local/include, and likewise for 
> /usr/include.

This sounds like an agreement that some form of change would be worthwhile; I'm
going to take that as confirmation.

> But there are certainly sysroot uses where include-fixed is 
> still relevant - where the sysroot is based on a copy of that used when 
> GCC was built, but with extra libraries added.  (That's the case of 
> sysroots that works most reliably for other reasons as well; GCC's runtime 
> libraries get configured depending on the libc libraries and headers 
> present when GCC was built, and in some cases the headers affect the 
> configuration of GCC itself as well as GCC's libraries.)
> 
> http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02088.html
> http://gcc.gnu.org/ml/gcc/2004-11/msg00255.html

Shouldn't it be possible to come up with a solution that still supports those
cases while also fixing the cases Paul described?

[Bug target/49854] Clean up SPE/e500 option handling

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49854

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=81084

--- Comment #1 from Eric Gallager  ---
bug 81084 is related to this

[Bug c++/84802] [8 Regression] ICE in gimplify_decl_expr since r251433

2018-03-11 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84802

Jason Merrill  changed:

   What|Removed |Added

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

[Bug other/43748] build machinery insufficient for installing target specific .def files as plugin headers

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43748

Eric Gallager  changed:

   What|Removed |Added

   Keywords||build
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-12
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Gallager  ---
(In reply to Andrew Paprocki from comment #1)
> This breaks the installation of gcc-4.5 via macports. When trying to build
> anything which uses the plugin API, it can't find darwin-sections.def so you
> have to manually extract it from the tarball and sudo cp it to the installed
> macports directory to get the build working.

Taking this as confirmation.

[Bug c++/84824] New: DCE fails to remove dead code of std::function constructor

2018-03-11 Thread manjian2006 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84824

Bug ID: 84824
   Summary: DCE fails to remove dead code of std::function
constructor
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: manjian2006 at gmail dot com
  Target Milestone: ---

#include 
#include 

std::function getFunc(int i) {
  auto f = [=] (int a, int b) {
return a + b + i;
  };
  return f;
}

int main() {
  printf("%d", getFunc(1)(1, 1));
  return 0;
}

In this example gcc generate code with redundant store operations and exception
handling block like:
main:
.LFB1411:
.cfi_startproc
.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
.cfi_lsda 0x1b,.LLSDA1411
pushq   %rbx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
leaq.LC0(%rip), %rsi
movl$3, %edx
movl$1, %edi
subq$48, %rsp
.cfi_def_cfa_offset 64
movq%fs:40, %rax
movq%rax, 40(%rsp)
xorl%eax, %eax
leaq   
_ZNSt17_Function_handlerIFiiiEZ7getFunciEUliiE_E9_M_invokeERKSt9_Any_dataOiS6_(%rip),
%rax
movl$1, (%rsp)
movq%rax, 24(%rsp)
leaq   
_ZNSt14_Function_base13_Base_managerIZ7getFunciEUliiE_E10_M_managerERSt9_Any_dataRKS3_St18_Manager_operation(%rip),
%rax
movq%rax, 16(%rsp)
xorl%eax, %eax
.LEHB0:
call__printf_chk@PLT
.LEHE0:
movq16(%rsp), %rax
testq   %rax, %rax
je  .L10
movq%rsp, %rdi
movl$3, %edx
movq%rdi, %rsi
call*%rax
.L10:
xorl%eax, %eax
movq40(%rsp), %rcx
xorq%fs:40, %rcx
jne .L23
addq$48, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 16
popq%rbx
.cfi_def_cfa_offset 8
ret


But clang manage to remove these code
main:   # @main
.cfi_startproc
# %bb.0:
pushq   %rax
.cfi_def_cfa_offset 16
movl$.L.str, %edi
movl$3, %esi
xorl%eax, %eax
callq   printf
xorl%eax, %eax
popq%rcx
retq


compiler flags are: -O2 -S

It seems gcc insist on construct std::function object on stack.

[Bug rtl-optimization/50696] [x32] Unnecessary lea

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50696

Eric Gallager  changed:

   What|Removed |Added

   Keywords||patch
 CC||egallager at gcc dot gnu.org

--- Comment #8 from Eric Gallager  ---
(In reply to H.J. Lu from comment #7)
> A patch is posted at
> 
> http://gcc.gnu.org/ml/gcc-patches/2011-10/msg01307.html

Adding "patch" keyword

[Bug target/33944] streaming 64-bit integer stores

2018-03-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33944

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
(In reply to h...@gcc.gnu.org from comment #2)
> Author: hjl
> Date: Fri Nov 18 19:02:45 2011
> New Revision: 181491
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181491
> Log:
> Add _mm_stream_si64.
> 
> 2011-11-18  H.J. Lu  
> 
>   PR target/33944
>   * doc/extend.texi: Document __builtin_ia32_movnti64.
> 
>   * config/i386/emmintrin.h (_mm_stream_si64): New.
> 
>   * config/i386/i386-builtin-types.def: Add VOID_FTYPE_PLONGLONG_LONGLONG.
> 
>   * config/i386/i386.c (ix86_builtins): Add IX86_BUILTIN_MOVNTI64.
>   (bdesc_special_args): Update __builtin_ia32_movnti.  Add
>   __builtin_ia32_movnti64.
>   (ix86_expand_special_args_builtin): Handle
>   VOID_FTYPE_PLONGLONG_LONGLONG.
> 
>   * config/i386/i386.md (UNSPEC_MOVNTI): New.
> 
>   * config/i386/sse.md (sse2_movntsi): Renamed to ...
>   (sse2_movnti): This.
> 
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/config/i386/emmintrin.h
> trunk/gcc/config/i386/i386-builtin-types.def
> trunk/gcc/config/i386/i386.c
> trunk/gcc/config/i386/i386.md
> trunk/gcc/config/i386/sse.md
> trunk/gcc/doc/extend.texi

Did this fix it?

[Bug c++/84824] DCE fails to remove dead code of std::function constructor

2018-03-11 Thread manjian2006 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84824

--- Comment #1 from linzj  ---
According to the tree generated, the problem is sourced from fail to remove the
lambda function call. But the constant value is deduced and propagated. In case
of the side effect?

[Bug c++/84824] DCE fails to remove dead code of std::function constructor

2018-03-11 Thread manjian2006 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84824

--- Comment #2 from linzj  ---
Okay, it's std::_Function_base::_Base_manager
>::_M_manager(std::_Any_data &, const std::_Any_data &,
std::_Manager_operation) (__dest=..., __source=...,
__op=std::__destroy_functor) 

function that dce fails to remove.

[Bug c++/84824] DCE fails to remove dead code of std::function constructor

2018-03-11 Thread manjian2006 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84824

--- Comment #3 from linzj  ---
From the function destructor
~_Function_base()
{
  if (_M_manager)
_M_manager(_M_functor, _M_functor, __destroy_functor);
}