[Bug fortran/61376] New: Error using private statement in polymorphic derived type

2014-05-31 Thread stuart.moffatt at axsym dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61376

Bug ID: 61376
   Summary: Error using private statement in polymorphic derived
type
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: stuart.moffatt at axsym dot co.uk

I am getting a compiler error with the gfortran v4.9.0 compiler when using the
private statement within a derived type class that is used to form a
polymorphic object. Conversely, ifort v14.0.2 does compile this code
successfully and the executable runs without error. The example source code
below results in the following error message from gfortran:

*** START ERROR MESSAGE ***
ch2605.poly.f90:58.2:

  s %x = shape_type(3)
  1
Error: Assignment to an allocatable polymorphic variable at (1) is not yet
supported
*** END ERROR MESSAGE ***

If the private statement is commented out and the entire shape_module
attributes/methods are made public, then gfortran compiles the code
successfully. It appears that there is no straightforwward way to make the
contents of the base derived type private. 

Notes: I have adapted this example source code from ch2605_2.f90 on the
fortranplus website. Standard gcc-4.9 installation using apt-get on Ubuntu
14.04 LTS. gfortran compiler options: -fcoarray=single.

*** START EXAMPLE SOURCE CODE ***
! Test to demonstrate problem private attributesin polymorphic 
! derived type using gfortan v4.9.0 (works OK in ifort v14.0.2)

module shape_module
  implicit none
  private! *** Commenting out this statement works with gfortran v4.9.0
  type shape_type
integer :: n_ 
character(len=2), allocatable, dimension(:) :: cname_  
  contains
procedure, pass(this) :: get_size
  end type shape_type
  interface shape_type
module procedure shape_type_constructor
  end interface
  interface assignment (=)
module procedure generic_shape_assign
  end interface
  public :: shape_type, generic_shape_assign
  public :: shape_type_constructor, get_size ! *** Not even this works.
contains

  type (shape_type) function shape_type_constructor(n)
implicit none
integer, intent (in) :: n
shape_type_constructor%n_ = n
allocate ( shape_type_constructor%cname_(n) ) 
  end function shape_type_constructor

  integer function get_size(this)
implicit none
class (shape_type), intent (in) :: this
get_size = size(this%cname_)
  end function get_size

  subroutine generic_shape_assign(lhs,rhs)
implicit none
class (shape_type), intent (out), allocatable :: lhs
class (shape_type), intent (in) :: rhs
allocate (lhs,source=rhs)
  end subroutine generic_shape_assign
end module shape_module


module shape_wrapper_module
  use shape_module
  type shape_wrapper
  class (shape_type), allocatable :: x
  end type shape_wrapper
end module shape_wrapper_module


program ch2605_mod
  use shape_module
  use shape_wrapper_module
  implicit none
  type (shape_wrapper) :: s
  s %x = shape_type(3)
  print *, 'size = ', s%x%get_size()
end program ch2605_mod
*** END EXAMPLE SOURCE CODE ***


[Bug c++/57543] decltype needs explicit 'this' pointer in member function declaration of template class with trailing return type

2014-05-31 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543

--- Comment #7 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Sat May 31 08:51:20 2014
New Revision: 211102

URL: http://gcc.gnu.org/viewcvs?rev=211102&root=gcc&view=rev
Log:
/cp
2014-05-31  Paolo Carlini  

DR 1227
PR c++/57543
* cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
* pt.c (tsubst_function_type): Inject the this parameter; do the
substitutions in the order mandated by the DR.
(copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
* decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
(static_fn_type): Copy it.
* decl2.c (build_memfn_type, change_return_type,
cp_reconstruct_complex_type): Likewise.
* parser.c (cp_parser_lambda_declarator_opt): Likewise.
* tree.c (strip_typedefs): Likewise.
* typeck.c (merge_types): Likewise.

/testsuite
2014-05-31  Paolo Carlini  

DR 1227
PR c++/57543
* g++.dg/cpp0x/pr57543-1.C: New.
* g++.dg/cpp0x/pr57543-2.C: Likewise.
* g++.dg/cpp0x/pr57543-3.C: Likewise.
* g++.dg/cpp0x/decltype59.C: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/decltype59.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr57543-1.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr57543-2.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr57543-3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/decl2.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/tree.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/54366] [meta-bug] decltype issues

2014-05-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54366
Bug 54366 depends on bug 57543, which changed state.

Bug 57543 Summary: decltype needs explicit 'this' pointer in member function 
declaration of template class with trailing return type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543

   What|Removed |Added

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


[Bug c++/57543] decltype needs explicit 'this' pointer in member function declaration of template class with trailing return type

2014-05-31 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57543

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org

--- Comment #8 from Paolo Carlini  ---
Fixed.


[Bug driver/60968] [4.9 Regression] Bootstrap fails on mingw32 with -dumpspecs

2014-05-31 Thread daniel.f.starke at freenet dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60968

--- Comment #5 from Daniel Starke  ---
Removing --disable-sjlj-exceptions solved the problem.
I did not try the current 4.9.1 branch yet.


[Bug libstdc++/61374] string_view::operator string() is buggy

2014-05-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61374

Jonathan Wakely  changed:

   What|Removed |Added

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


[Bug libstdc++/61374] string_view::operator string() is buggy

2014-05-31 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61374

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |4.9.1


[Bug target/61377] New: [4.10 Regression] Bootstrap failure on x86_64-apple-darwin13

2014-05-31 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61377

Bug ID: 61377
   Summary: [4.10 Regression] Bootstrap failure on
x86_64-apple-darwin13
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dominiq at lps dot ens.fr
CC: iains at gcc dot gnu.org
  Host: x86_64-apple-darwin13
Target: x86_64-apple-darwin13
 Build: x86_64-apple-darwin13

Bootstrapping r211103 fails on x86_64-apple-darwin13 while building libjava
with -m32:

libtool: compile:  /opt/gcc/build_c/./gcc/xgcc -shared-libgcc
-B/opt/gcc/build_c/./gcc -nostdinc++
-L/opt/gcc/build_c/x86_64-apple-darwin13.2.0/i386/libstdc++-v3/src
-L/opt/gcc/build_c/x86_64-apple-darwin13.2.0/i386/libstdc++-v3/src/.libs
-L/opt/gcc/build_c/x86_64-apple-darwin13.2.0/i386/libstdc++-v3/libsupc++/.libs
-B/opt/gcc/gcc4.10c/x86_64-apple-darwin13.2.0/bin/
-B/opt/gcc/gcc4.10c/x86_64-apple-darwin13.2.0/lib/ -isystem
/opt/gcc/gcc4.10c/x86_64-apple-darwin13.2.0/include -isystem
/opt/gcc/gcc4.10c/x86_64-apple-darwin13.2.0/sys-include -m32 -DHAVE_CONFIG_H
-I. -I../../../../_clean/libjava -I./include -I./gcj
-I../../../../_clean/libjava -Iinclude -I../../../../_clean/libjava/include
-I../../../../_clean/libjava/classpath/include -Iclasspath/include
-I../../../../_clean/libjava/classpath/native/fdlibm
-I../../../../_clean/libjava/../boehm-gc/include -I../boehm-gc/include
-I../../../../_clean/libjava/libltdl -I../../../../_clean/libjava/libltdl
-I../../../../_clean/libjava/.././libjava/../libgcc
-I../../../../_clean/libjava/../libffi/include -I../libffi/include -fno-rtti
-fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum
-D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Usun -Wextra -Wall
-D_GNU_SOURCE -DPREFIX=\"/opt/gcc/gcc4.10c\"
-DTOOLEXECLIBDIR=\"/opt/gcc/gcc4.10c/lib/i386\"
-DJAVA_HOME=\"/opt/gcc/gcc4.10c\"
-DBOOT_CLASS_PATH=\"/opt/gcc/gcc4.10c/share/java/libgcj-4.10.0.jar\"
-DJAVA_EXT_DIRS=\"/opt/gcc/gcc4.10c/share/java/ext\"
-DGCJ_ENDORSED_DIRS=\"/opt/gcc/gcc4.10c/share/java/gcj-endorsed\"
-DGCJ_VERSIONED_LIBDIR=\"/opt/gcc/gcc4.10c/lib/i386/gcj-4.10.0-15\"
-DPATH_SEPARATOR=\":\" -DECJ_JAR_FILE=\"\"
-DLIBGCJ_DEFAULT_DATABASE=\"/opt/gcc/gcc4.10c/lib/i386/gcj-4.10.0-15/classmap.db\"
-DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.10.0-15/classmap.db\" -g -O2 -m32
-MT gnu/gcj/natCore.lo -MD -MP -MF gnu/gcj/.deps/natCore.Tpo -c
../../../../_clean/libjava/gnu/gcj/natCore.cc  -fno-common -DPIC -o
gnu/gcj/.libs/natCore.o
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccJoNqSO.s:89:non-relocatable
subtraction expression, "__Jv_RegisterCoreHook" minus "L2$pb"
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccJoNqSO.s:89:symbol: "L2$pb"
can't be undefined in a subtraction expression
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr0gn/T//ccJoNqSO.s:unknown:Undefined
local symbol L2$pb
make[5]: *** [gnu/gcj/natCore.lo] Error 1


[Bug c/61378] New: Obvious bug in vn_reference_lookup_3

2014-05-31 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61378

Bug ID: 61378
   Summary: Obvious bug in vn_reference_lookup_3
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dcb314 at hotmail dot com

Valgrind says

==15936== Conditional jump or move depends on uninitialised value(s)
==15936==at 0xBE5839: vn_reference_lookup_3(ao_ref*, tree_node*, void*,
bool) (tree-ssa-sccvn.c:1627)

Source code is

  bool valueized_anything;
  for (unsigned i = 0; i < gimple_call_num_args (def_stmt); ++i)
{
  oldargs[i] = gimple_call_arg (def_stmt, i);
  if (TREE_CODE (oldargs[i]) == SSA_NAME
  && VN_INFO (oldargs[i])->valnum != oldargs[i])
{
  gimple_call_set_arg (def_stmt, i, VN_INFO (oldargs[i])->valnum);
  valueized_anything = true;
}
}
  if (valueized_anything)

Suggest init valueized_anything at its declaration.
Use of svn blame shows

210160rguenth   if (valueized_anything)


[Bug target/61331] [ARM] GCC build broken since r210964/r210965

2014-05-31 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61331

--- Comment #7 from Bernd Edlinger  ---
Fixed with r211050.  Thanks!


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

2014-05-31 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

--- Comment #8 from Eric Botcazou  ---
> Sure, I'll push a patch for this as soon as I finish fixing the regressions
> that poped up due to the change I made to the bswap pass.

While you're at it, could you change all the references in the code (as well as
the ChangeLog) to "host endianness", which is mightily confusing in a compiler?

By definition a compiler generates code for a target, not for a host.


[Bug driver/60968] [4.9 Regression] Bootstrap fails on mingw32 with -dumpspecs

2014-05-31 Thread daniel.f.starke at freenet dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60968

--- Comment #6 from Daniel Starke  ---
I can confirm that the problem does not occur in r211103 of the 4.9 branch.


[Bug target/61377] [4.10 Regression] Bootstrap failure on x86_64-apple-darwin13

2014-05-31 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61377

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-05-31
 CC||ktietz70 at googlemail dot com
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Caused by r211089. Fixed by the patch at
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg02689.html.


[Bug target/61377] [4.10 Regression] Bootstrap failure on x86_64-apple-darwin13

2014-05-31 Thread howarth.at.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61377

Jack Howarth  changed:

   What|Removed |Added

 CC||howarth.at.gcc at gmail dot com

--- Comment #2 from Jack Howarth  ---
(In reply to Dominique d'Humieres from comment #1)
> Caused by r211089. Fixed by the patch at
> https://gcc.gnu.org/ml/gcc-patches/2014-05/msg02689.html.

The patch posted there is malformed. It appears to have been hand-editted to
remove…

   [(set_attr "type" "call")])

+; TODO
+(define_peephole2
+  [(set (match_operand:DI 0 "register_operand")
+(match_operand:DI 1 "memory_operand"))
+   (unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
+  "TARGET_64BIT"
+  [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
+   (set (match_dup 0)
+(match_dup 1))])
+
+(define_peephole2
+  [(set (match_operand:SI 0 "register_operand")
+(match_operand:SI 1 "memory_operand"))
+   (unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
+  "!TARGET_64BIT"
+  [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
+   (set (match_dup 0)
+(match_dup 1))])
+
+(define_peephole2
+  [(set (match_operand:DI 0 "register_operand")
+(match_operand:DI 1 "memory_operand"))
+   (call (mem:QI (match_operand:DI 2 "register_operand"))
+ (match_operand 3))]
+  "TARGET_64BIT  && REG_P (operands[0]) && 0
+&& REG_P (operands[2])
+&& REGNO (operands[0]) == REGNO (operands[2])"
+  [(call (mem:QI (match_dup 1)) (match_dup 1))])
+
 (define_expand "call_pop"
   [(parallel [(call (match_operand:QI 0)
 (match_operand:SI 1))

from the original patch at
http://gcc.gnu.org/ml/gcc-patches/2014-05/msg02686.html rather than having been
properly regenerated. Is unclear what exactly was approved here.

[Bug c++/61379] New: __attribute__((noreturn)) ignored on pure virtual member functions

2014-05-31 Thread meiomorphism at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61379

Bug ID: 61379
   Summary: __attribute__((noreturn)) ignored on pure virtual
member functions
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: meiomorphism at gmail dot com

Created attachment 32881
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32881&action=edit
test file (#include-free)

Pure-virtual member functions with __attribute__((noreturn)) attached are not
recognized as being noreturn. This can lead to spurious warnings.

Use of [[noreturn]] rather than __attribute__((noreturn)) yields the same
behavior.

Tested on both Debian wheezy's gcc 4.7.2 and a locally-compiled
officially-sourced gcc 4.9.0. The output of `g++ -v' for the latter is given
below.

To reproduce, compile the attached file with -Wall; the spurious warning
> virtual-noreturn.cpp:12:1: warning: control reaches end of non-void function 
> [-Wreturn-type]
(some context omitted) will be given.


=== BEGIN g++ -v output ===
Using built-in specs.
COLLECT_GCC=/home/user/local/gcc-4.9/bin/g++
COLLECT_LTO_WRAPPER=/home/user/local/gcc-4.9/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/user/src/gcc-4.9.0/configure
--prefix=/home/user/local/gcc-4.9
--with-local-prefix=/home/user/local/gcc-4.9-include --disable-bootstrap
--disable-multilib : (reconfigured) /home/user/src/gcc-4.9.0/configure
--prefix=/home/user/local/gcc-4.9
--with-local-prefix=/home/user/local/gcc-4.9-include --disable-bootstrap
--disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 4.9.0 (GCC) 
=== END gcc -v output ===