From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27713 invoked by alias); 17 Jul 2014 20:15:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27604 invoked by uid 48); 17 Jul 2014 20:15:37 -0000 From: "ilja.j.honkonen at nasa dot gov" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61836] New: Incorrect template argument deduction/substitution failure? Date: Thu, 17 Jul 2014 20:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ilja.j.honkonen at nasa dot gov X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01262.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61836 Bug ID: 61836 Summary: Incorrect template argument deduction/substitution failure? Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ilja.j.honkonen at nasa dot gov Created attachment 33137 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D33137&action=3Dedit Preprocessed source Trying to enable_if a particular implementation of a class member function based on its template argument: template< class Out_T > typename std::enable_if< std::is_same::value, Out_T >::type get_parsed_value(...) template< class Out_T > typename std::enable_if< std::is_same::value, Out_T >::type get_parsed_value(...) including std::array and Eigen::Matrix: template struct is_std_array_double : std::false_type {}; template struct is_std_array_double< std::array > : std::true_type {}; template struct is_eigen_vector_double : std::false_type {}; template struct is_eigen_vector_double< Eigen::Matrix > : std::true_type {}; template< class Out_T > typename std::enable_if< detail::is_std_array_double::value, Out_T >::type get_parsed_value(...) template< class Out_T > typename std::enable_if< detail::is_eigen_vector_double::value, Out_T >::type get_parsed_value(...) fails because apparently is_eigen_vector_double returns false for Eigen::Matrix even though it shouldn't. The same code compiles with clangs 3.3-5. Compile command: /opt/local/gcc-4.9.1/bin/g++ -I source -std=3Dc++11 -W -Wall -Wextra -pedan= tic -O3 -I /opt/local/include/eigen3 -I /opt/local/include -L /opt/local/lib -lboost_coroutine-mt -lboost_system-mt -lboost_random-mt -lboost_program_options-mt -I /Users/iljah/include -L /Users/iljah/lib -lmuparserx -I /Users/iljah/include tests/program_options/variable_to_option.cpp -o tests/program_options/variable_to_option.exe -Wno-unused-local-typedefs -save-temps -v Output: Using built-in specs. COLLECT_GCC=3D/opt/local/gcc-4.9.1/bin/g++ COLLECT_LTO_WRAPPER=3D/opt/local/gcc-4.9.1/libexec/gcc/x86_64-apple-darwin1= 3.3.0/4.9.1/lto-wrapper Target: x86_64-apple-darwin13.3.0 Configured with: ../gcc-4.9.1/configure --prefix=3D/opt/local/gcc-4.9.1 --enable-shared --enable-threads=3Dposix --enable-__cxa_atexit --disable-mu= ltilib --with-system-zlib --enable-languages=3Dc,c++ --with-gmp=3D/opt/local --with-mpfr=3D/opt/local --with-mpc=3D/opt/local --disable-bootstrap Thread model: posix gcc version 4.9.1 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-mmacosx-version-min=3D10.9.3' '-I' 'source' '-std= =3Dc++11' '-Wall' '-Wextra' '-Wpedantic' '-O3' '-I' '/opt/local/include/eigen3' '-I' '/opt/local/include' '-L/opt/local/lib' '-I' '/Users/iljah/include' '-L/Users/iljah/lib' '-I' '/Users/iljah/include' '-o' 'tests/program_options/variable_to_option.exe' '-Wno-unused-local-typedefs' '-save-temps' '-v' '-shared-libgcc' '-mtune=3Dcore2' /opt/local/gcc-4.9.1/libexec/gcc/x86_64-apple-darwin13.3.0/4.9.1/cc1plus -E -quiet -v -I source -I /opt/local/include/eigen3 -I /opt/local/include -I /Users/iljah/include -I /Users/iljah/include -D__DYNAMIC__ tests/program_options/variable_to_option.cpp -fPIC -mmacosx-version-min=3D1= 0.9.3 -mtune=3Dcore2 -std=3Dc++11 -Wall -Wextra -Wpedantic -Wno-unused-local-type= defs -O3 -fpch-preprocess -o variable_to_option.ii ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/../../../../x= 86_64-apple-darwin13.3.0/include" ignoring duplicate directory "/Users/iljah/include" #include "..." search starts here: #include <...> search starts here: source /opt/local/include/eigen3 /opt/local/include /Users/iljah/include /opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/../../../../in= clude/c++/4.9.1 /opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/../../../../in= clude/c++/4.9.1/x86_64-apple-darwin13.3.0 /opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/../../../../in= clude/c++/4.9.1/backward /opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/include /opt/local/gcc-4.9.1/include /opt/local/gcc-4.9.1/lib/gcc/x86_64-apple-darwin13.3.0/4.9.1/include-fixed /usr/include /System/Library/Frameworks /Library/Frameworks End of search list. COLLECT_GCC_OPTIONS=3D'-mmacosx-version-min=3D10.9.3' '-I' 'source' '-std= =3Dc++11' '-Wall' '-Wextra' '-Wpedantic' '-O3' '-I' '/opt/local/include/eigen3' '-I' '/opt/local/include' '-L/opt/local/lib' '-I' '/Users/iljah/include' '-L/Users/iljah/lib' '-I' '/Users/iljah/include' '-o' 'tests/program_options/variable_to_option.exe' '-Wno-unused-local-typedefs' '-save-temps' '-v' '-shared-libgcc' '-mtune=3Dcore2' /opt/local/gcc-4.9.1/libexec/gcc/x86_64-apple-darwin13.3.0/4.9.1/cc1plus -fpreprocessed variable_to_option.ii -fPIC -quiet -dumpbase variable_to_option.cpp -mmacosx-version-min=3D10.9.3 -mtune=3Dcore2 -auxbase variable_to_option -O3 -Wall -Wextra -Wpedantic -Wno-unused-local-typedefs -std=3Dc++11 -version -o variable_to_option.s GNU C++ (GCC) version 4.9.1 (x86_64-apple-darwin13.3.0) compiled by GNU C version 4.8.2, GMP version 6.0.0, MPFR version 3.1.1-= p2, MPC version 1.0.2 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C++ (GCC) version 4.9.1 (x86_64-apple-darwin13.3.0) compiled by GNU C version 4.8.2, GMP version 6.0.0, MPFR version 3.1.1-= p2, MPC version 1.0.2 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: bd2008a6eb882424f30fe6b02f71d084 In file included from tests/program_options/variable_to_option.cpp:41:0: source/boundaries/variable_to_option.hpp: In instantiation of =E2=80=98type= name Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:366:13: error: no matching function for call to =E2=80=98pamhd::boundaries::Variable_To_Option::get_parse= d_value(const std::array&)=E2=80=99 >(position); ^ source/boundaries/variable_to_option.hpp:366:13: note: candidates are: source/boundaries/variable_to_option.hpp:408:10: note: template typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Out_T; Last_Variable =3D Momentum_Density] >::type get_parsed_value(const std::array& position) ^ source/boundaries/variable_to_option.hpp:408:10: note: template argument deduction/substitution failed: source/boundaries/variable_to_option.hpp: In substitution of =E2=80=98templ= ate typename std::enable_if::value, Out_T>::ty= pe pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Eigen::Matrix]=E2= =80=99: source/boundaries/variable_to_option.hpp:366:13: required from =E2=80=98t= ypename Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99 tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:408:10: error: no type named =E2= =80=98type=E2=80=99 in =E2=80=98struct std::enable_if >=E2=80=99 source/boundaries/variable_to_option.hpp: In instantiation of =E2=80=98type= name Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:430:10: note: template typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Out_T; Last_Variable =3D Momentum_Density] >::type get_parsed_value(const std::array& position) ^ source/boundaries/variable_to_option.hpp:430:10: note: template argument deduction/substitution failed: source/boundaries/variable_to_option.hpp: In substitution of =E2=80=98templ= ate typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Eigen::Matrix]=E2= =80=99: source/boundaries/variable_to_option.hpp:366:13: required from =E2=80=98t= ypename Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99 tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:430:10: error: no type named =E2= =80=98type=E2=80=99 in =E2=80=98struct std::enable_if >=E2=80=99 source/boundaries/variable_to_option.hpp: In instantiation of =E2=80=98type= name Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:452:10: note: template typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Out_T; Last_Variable =3D Momentum_Density] >::type get_parsed_value(const std::array& position) ^ source/boundaries/variable_to_option.hpp:452:10: note: template argument deduction/substitution failed: source/boundaries/variable_to_option.hpp: In substitution of =E2=80=98templ= ate typename std::enable_if::value, Out_T>::= type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Eigen::Matrix]=E2= =80=99: source/boundaries/variable_to_option.hpp:366:13: required from =E2=80=98t= ypename Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99 tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:452:10: error: no type named =E2= =80=98type=E2=80=99 in =E2=80=98struct std::enable_if >=E2=80=99 source/boundaries/variable_to_option.hpp: In instantiation of =E2=80=98type= name Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:474:10: note: template typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Out_T; Last_Variable =3D Momentum_Density] >::type get_parsed_value(const std::array& position) ^ source/boundaries/variable_to_option.hpp:474:10: note: template argument deduction/substitution failed: source/boundaries/variable_to_option.hpp: In substitution of =E2=80=98templ= ate typename std::enable_if::value, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Eigen::Matrix]=E2= =80=99: source/boundaries/variable_to_option.hpp:366:13: required from =E2=80=98t= ypename Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99 tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:474:10: error: no type named =E2= =80=98type=E2=80=99 in =E2=80=98struct std::enable_if >=E2=80=99 source/boundaries/variable_to_option.hpp: In instantiation of =E2=80=98type= name Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:529:10: note: template typename std::enable_if::va= lue, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Out_T; Last_Variable =3D Momentum_Density] >::type get_parsed_value(const std::array& position) ^ source/boundaries/variable_to_option.hpp:529:10: note: template argument deduction/substitution failed: source/boundaries/variable_to_option.hpp: In substitution of =E2=80=98templ= ate typename std::enable_if::va= lue, Out_T>::type pamhd::boundaries::Variable_To_Option::get_parsed_value(const std::array&) [with Out_T =3D Eigen::Matrix]=E2= =80=99: source/boundaries/variable_to_option.hpp:366:13: required from =E2=80=98t= ypename Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99 tests/program_options/variable_to_option.cpp:135:57: required from here source/boundaries/variable_to_option.hpp:529:10: error: no type named =E2= =80=98type=E2=80=99 in =E2=80=98struct std::enable_if >=E2=80=99 source/boundaries/variable_to_option.hpp: In member function =E2=80=98typen= ame Last_Variable::data_type pamhd::boundaries::Variable_To_Option::get_data(const Last_Variable&, const std::array&) [with Last_Variable =3D Momentum_Density; typename Last_Variable::data_type =3D Eigen::Matrix]=E2=80=99: source/boundaries/variable_to_option.hpp:367:2: warning: control reaches en= d of non-void function [-Wreturn-type] } ^ >>From gcc-bugs-return-456672-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jul 17 20:41:43 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 20076 invoked by alias); 17 Jul 2014 20:41:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 19852 invoked by uid 48); 17 Jul 2014 20:41:33 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61831] [4.9.1 regression] runtime error: pointer being freed was not allocated Date: Thu, 17 Jul 2014 20:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01263.txt.bz2 Content-length: 3543 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61831 --- Comment #5 from Dominique d'Humieres --- > Confirmed with 4.9.1 revision r212339. AFAICT revision r210749 is OK. > I suspect r211405 for 4.10 and r212329 for 4.9. Can you revert r212329 > and see if the error disappear? I am afraid that I am the culprit, i.e., r212329: I get the error with r209838 + the patch in r212329. However the failures are not exactly the same: with 4.9.1 revision r212339, it is | Creating decay process library for particle W+ | Process library 'default_lib_dp24': initialized | decay_p24_1: W+ => dbar u | Process library 'default_lib_dp24': recorded process 'decay_p24_1' | decay_p24_2: ?O => sbar c | Process library 'default_lib_dp24': recorded process 'decay_p24_2' | decay_p24_3: => e+ nue whizard(32872,0x7fff7738d310) malloc: *** error for object 0x7f805874ea60: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug while with r209838 + patch, it is | Creating decay process library for particle W+ | Process library 'default_lib_dp24': initialized | decay_p24_1: W+ => dbar u | Process library 'default_lib_dp24': recorded process 'decay_p24_1' | decay_p24_2: => sbar c | Process library 'default_lib_dp24': recorded process 'decay_p24_2' whizard(36947,0x7fff7738d310) malloc: *** error for object 0x7fb8c3755810: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug For 4.9.0, I get | Creating decay process library for particle W+ | Process library 'default_lib_dp24': initialized | decay_p24_1: W+ => dbar u | Process library 'default_lib_dp24': recorded process 'decay_p24_1' | decay_p24_2: W+ => sbar c | Process library 'default_lib_dp24': recorded process 'decay_p24_2' | decay_p24_3: W+ => e+ nue | Process library 'default_lib_dp24': recorded process 'decay_p24_3' | decay_p24_4: W+ => mu+ numu | Process library 'default_lib_dp24': recorded process 'decay_p24_4' | decay_p24_5: W+ => tau+ nutau | Process library 'default_lib_dp24': recorded process 'decay_p24_5' | Integrate: current process library needs compilation | Process library 'default_lib_dp24': compiling ... | Process library 'default_lib_dp24': writing makefile | Process library 'default_lib_dp24': writing driver | Process library 'default_lib_dp24': creating source code rm -f decay_p24_1_i1.f90 rm -f opr_decay_p24_1_i1.mod rm -f decay_p24_1_i1.lo rm -f decay_p24_2_i1.f90 rm -f opr_decay_p24_2_i1.mod rm -f decay_p24_2_i1.lo rm -f decay_p24_3_i1.f90 rm -f opr_decay_p24_3_i1.mod rm -f decay_p24_3_i1.lo rm -f decay_p24_4_i1.f90 rm -f opr_decay_p24_4_i1.mod rm -f decay_p24_4_i1.lo rm -f decay_p24_5_i1.f90 rm -f opr_decay_p24_5_i1.mod rm -f decay_p24_5_i1.lo /usr/local/bin/omega_SM.opt -o decay_p24_1_i1.f90 -target:whizard -target:parameter_module parameters_SM -target:module opr_decay_p24_1_i1 -target:md5sum 'B42EAF21C73773800B93C9AE1495DD00' -fusion:progress -decay 'W+ -> dbar u' make: /usr/local/bin/omega_SM.opt: Command not found make: *** [decay_p24_1_i1.f90] Error 127 | command: make source -j1 -f default_lib_dp24.makefile | Return code = 512 ****************************************************************************** ****************************************************************************** *** FATAL ERROR: System command returned with nonzero status code ****************************************************************************** ****************************************************************************** WHIZARD run aborted.