[Bug target/50970] Function pointer dereferenced twice in if statement on Arm cpu

2013-03-25 Thread pinskia at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50970



Andrew Pinski pinskia at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.0



--- Comment #11 from Andrew Pinski pinskia at gcc dot gnu.org 2013-03-25 
06:23:29 UTC ---

Fixed.


[Bug bootstrap/56689] internal compiler error: in get_loop_body, at cfgloop.c:841

2013-03-25 Thread krebbel at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56689

Andreas Krebbel krebbel at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #29707|0   |1
is obsolete||

--- Comment #3 from Andreas Krebbel krebbel at gcc dot gnu.org 2013-03-25 
08:01:00 UTC ---
Created attachment 29717
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29717
Manually reduced testcase

cc1 -O2 t.c

t.c: In function ‘fix_register’:
t.c:6:1: error: size of loop 1 should be 7, not 8
 fix_register (const char *name, int fixed, int call_used, int nregs)
 ^
t.c:6:1: internal compiler error: in verify_loop_structure, at cfgloop.c:1640
0x80227273 verify_loop_structure()
/home/andreas/clean/gcc-head/gcc/cfgloop.c:1640
0x8076488f perform_tree_ssa_dce
/home/andreas/clean/gcc-head/gcc/tree-ssa-dce.c:1554
0x80764be1 tree_ssa_cd_dce
/home/andreas/clean/gcc-head/gcc/tree-ssa-dce.c:1637
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.

[Bug c++/56038] declarations in xmmintrin.h conflict with mingw-w64 intrin.h in c++ mode

2013-03-25 Thread ktietz at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56038



Kai Tietz ktietz at gcc dot gnu.org changed:



   What|Removed |Added



 CC||ktietz at gcc dot gnu.org



--- Comment #3 from Kai Tietz ktietz at gcc dot gnu.org 2013-03-25 08:20:59 
UTC ---

Issue is an old one ... I had even posted already a patch for this subject. 

See as reference http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00033.html link.



The only way to solve this in a sane way is by moving it into C namespace for

C++.


[Bug c++/56715] Explicit Reg Vars are being ignored for consts when using g++

2013-03-25 Thread jakub at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56715



Jakub Jelinek jakub at gcc dot gnu.org changed:



   What|Removed |Added



 CC||jakub at gcc dot gnu.org



--- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org 2013-03-25 
08:50:15 UTC ---

Simply don't use const on the register asm vars for C++.  The thing is that

already the C++ frontend is replacing all the r4 const var uses with just

0x1000 (i.e. the initializer), that isn't really an optimization, but part of

C++ semantics.  r4 is an integral constant expression that evaluates to 0x1000.

 See

ISO C++ 98, [expr.const]/1.  So in foo what you are doing is actually

void foo() {

register const int r4 asm(r4) = 0x1000;

asm volatile(swi #1 : : r(0x1000));

}

and that of course can use any available register.


[Bug bootstrap/56689] internal compiler error: in get_loop_body, at cfgloop.c:841

2013-03-25 Thread krebbel at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56689



--- Comment #4 from Andreas Krebbel krebbel at gcc dot gnu.org 2013-03-25 
09:14:52 UTC ---

phicprop2:

  bb 9:

  switch (fixed_11(D)) default: L15, case 0: L6, case 1: L12



vrp2:

  bb 9:

  switch (fixed_13(D)) default: L15, case 1: L12



L6: (bb 10)

  switch (call_used_12(D)) default: L8, case 1: L7





VRP optimizes the case 0: L6 away. So there is no edge between bb9 and bb10

anymore. Due to that dfs_enumerate_from does not consider bb9 to be part of the

loop anymore. It counts 7 instead of 8 bbs for the loop due to this.


[Bug rtl-optimization/56434] document that __attribute__((__malloc__)) assumes returned pointer has BIGGEST_ALIGNMENT

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56434



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

  Known to work||4.8.0

 Resolution||FIXED



--- Comment #11 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
09:41:29 UTC ---

Author: rguenth

Date: Mon Mar 25 09:39:52 2013

New Revision: 197030



URL: http://gcc.gnu.org/viewcvs?rev=197030root=gccview=rev

Log:

2013-03-25  Richard Biener  rguent...@suse.de



PR middle-end/56434

* calls.c (expand_call): Use MALLOC_ABI_ALIGNMENT to annotate

the pointer returned by calls with ECF_MALLOC set.



Modified:

trunk/gcc/ChangeLog

trunk/gcc/calls.c


[Bug tree-optimization/56717] New: Enhance Dot-product pattern recognition to avoid mult widening.

2013-03-25 Thread ysrumyan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56717



 Bug #: 56717

   Summary: Enhance Dot-product pattern recognition to avoid mult

widening.

Classification: Unclassified

   Product: gcc

   Version: 4.9.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: tree-optimization

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: ysrum...@gmail.com





Comparing performance of icc and gcc compilers we found out that for one

important benchmark from eembc 1.1 suite gcc produces very poor code in

comparison with icc. This deficiency can be illustrated by the following simple

example:



typedef signed short s16;

typedef signed long  s32;

void bar (s16 *in1, s16 *in2, s16 *out, int n, s16 scale)

{

  int i;

  s32 acc = 0;

  for (i=0; in; i++)

acc += ((s32) in1[i] * (s32) in2[i])  scale;

  *out = (s16) acc;

}

gcc performes mult widening conversion for it which does not look reasonable

and leads to suboptiml code for x86 at least.



I assume that Dot-prodeuct pattern recognition can be simply enhanced to accept

such case by allowing the following stmts:



 type x_t, y_t;

 TYPE1 prod;

 TYPE2 sum = init;

   loop:

 sum_0 = phi init, sum_1

 S1  x_t = ...

 S2  y_t = ...

 S3  x_T = (TYPE1) x_t;

 S4  y_T = (TYPE1) y_t;

 S5  prod = x_T * y_T;

 [S6  prod = (TYPE2) prod;  #optional]

 S6' prod1 = prod1 bin-op opnd

 S7  sum_1 = prod1 + sum_0;



where S6' is vectorizable.


[Bug middle-end/56712] [4.6 Regression] constructor function is called twice

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56712



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Priority|P3  |P2

 Status|UNCONFIRMED |NEW

  Known to work||4.5.3, 4.7.0

   Keywords||wrong-code

   Last reconfirmed||2013-03-25

 CC||pbrook at gcc dot gnu.org

 Ever Confirmed|0   |1

Summary|constructor function is |[4.6 Regression]

   |called twice|constructor function is

   ||called twice

   Target Milestone|--- |4.6.4

  Known to fail||4.6.3



--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
10:14:40 UTC ---

Thus confirmed.  Can eventually be backported to the next 4.6 release.


[Bug bootstrap/56714] [4.9 regression] Bootstrap failure libitm/local_atomic:1580:3: error: always_inline function might not be inlinable

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56714



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 CC||andi-gcc at firstfloor dot

   ||org

   Target Milestone|--- |4.9.0


[Bug c++/56715] Explicit Reg Vars are being ignored for consts when using g++

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56715



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||INVALID



--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
10:18:10 UTC ---

Thus invalid.


[Bug target/56707] [4.7 regression] ICE in distance_non_agu_define_in_bb for -mtune=atom -O2

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56707



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||ice-on-valid-code

   Priority|P3  |P2

   Target Milestone|--- |4.7.3


[Bug lto/56706] [4.8/4.9 Regression] failure building CP2K at -flto -O2

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56706



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Target Milestone|--- |4.8.1

Summary|[4.8 Regression] failure|[4.8/4.9 Regression]

   |building CP2K at -flto -O2  |failure building CP2K at

   ||-flto -O2


[Bug middle-end/56705] 4.8-20130319 misdiagnoses initialized var (regression from 4.7.2)

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56705



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||diagnostic,

   ||missed-optimization

 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

 Ever Confirmed|0   |1

  Known to fail||4.8.0



[Bug rtl-optimization/55278] [4.8/4.9 Regression] Botan performance regressions apparently due to LRA

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55278



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||missed-optimization

   Priority|P3  |P2

   Target Milestone|--- |4.8.1


[Bug tree-optimization/56695] [4.9 Regression] ICE in expand_vec_cond_expr, at optabs.c:6751

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56695



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



  Known to work||4.8.0

   Target Milestone|--- |4.9.0

Summary|ICE in  |[4.9 Regression] ICE in

   |expand_vec_cond_expr, at|expand_vec_cond_expr, at

   |optabs.c:6751   |optabs.c:6751



--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
10:23:52 UTC ---

Seems to work with 4.8.0 as well.


[Bug c++/56694] [4.8/4.9 Regression] Internal compiler error when compiling OpenMP code

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56694



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|WAITING |ASSIGNED

 AssignedTo|unassigned at gcc dot   |rguenth at gcc dot gnu.org

   |gnu.org |

   Target Milestone|--- |4.8.1

Summary|Internal compiler error |[4.8/4.9 Regression]

   |when compiling OpenMP code  |Internal compiler error

   ||when compiling OpenMP code



--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
10:25:58 UTC ---

Confirmed.



 /abuild/rguenther/gcc48-g/gcc/cc1plus  -quiet t.ii -fopenmp -m32 -O2

GObservations_optimizer.cpp: In member function 'virtual void

GObservations::optimizer::eval(const GOptimizerPars)':

GObservations_optimizer.cpp:188:6: error: location references block not in

block tree

# VUSE .MEM_295

std::terminate ();



GObservations_optimizer.cpp:188:6: internal compiler error: verify_gimple

failed

0xc92abe verify_gimple_in_cfg(function*)

/space/rguenther/src/svn/gcc-4_8-branch/gcc/tree-cfg.c:4738

0xb768c1 execute_function_todo

/space/rguenther/src/svn/gcc-4_8-branch/gcc/passes.c:1963

0xb75c19 do_per_function

/space/rguenther/src/svn/gcc-4_8-branch/gcc/passes.c:1701

0xb769e5 execute_todo

/space/rguenther/src/svn/gcc-4_8-branch/gcc/passes.c:1996

Please submit a full bug report,



I will take a look.


[Bug tree-optimization/56718] New: Early inlining prevents type based devirtualization

2013-03-25 Thread jamborm at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56718



 Bug #: 56718

   Summary: Early inlining prevents type based devirtualization

Classification: Unclassified

   Product: gcc

   Version: 4.9.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: tree-optimization

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: jamb...@gcc.gnu.org





Created attachment 29718

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29718

Testcase



The attached testcase runs 2.5 times faster (on my x86_64 desktop at

-O3) when early inlining is disabled.  The reason is that while

inlining and IPA-CP can work out the type of the object in

checkGetElement and checkSetElement, early inlining cannot and after

it puts the virtual call into the same function with the definition of

the object, there is subsequently no mechanism to do the

devirtualization in such intraprocedural setting.


[Bug tree-optimization/56718] Early inlining prevents type based devirtualization

2013-03-25 Thread jamborm at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56718



Martin Jambor jamborm at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |ASSIGNED

   Last reconfirmed||2013-03-25

 AssignedTo|unassigned at gcc dot   |jamborm at gcc dot gnu.org

   |gnu.org |

 Ever Confirmed|0   |1


[Bug bootstrap/56689] [4.9 Regression] internal compiler error: in get_loop_body, at cfgloop.c:841

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56689



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |ASSIGNED

   Last reconfirmed||2013-03-25

 AssignedTo|unassigned at gcc dot   |rguenth at gcc dot gnu.org

   |gnu.org |

   Target Milestone|--- |4.9.0

Summary|internal compiler error: in |[4.9 Regression] internal

   |get_loop_body, at   |compiler error: in

   |cfgloop.c:841   |get_loop_body, at

   ||cfgloop.c:841

 Ever Confirmed|0   |1



--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
10:37:25 UTC ---

I have a patch.


[Bug c++/56038] declarations in xmmintrin.h conflict with mingw-w64 intrin.h in c++ mode

2013-03-25 Thread net147 at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56038



--- Comment #4 from Jonathan Liu net147 at gmail dot com 2013-03-25 10:38:33 
UTC ---

Created attachment 29719

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29719

Add extern C modifier in intrinsics headers for C++


[Bug rtl-optimization/55278] [4.8/4.9 Regression] Botan performance regressions apparently due to LRA

2013-03-25 Thread hubicka at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55278



--- Comment #2 from Jan Hubicka hubicka at gcc dot gnu.org 2013-03-25 
11:03:36 UTC ---

Yep, Botan tends to be very random, see our benchmarks.  I looked into some of

the loops and they are very tight written in a bit particular way, so a lot of

performance changes are really by a chance.



Some better analysis would be desirable however.


[Bug c++/56715] Explicit Reg Vars are being ignored for consts when using g++

2013-03-25 Thread goswin-v-b at web dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56715



Goswin von Brederlow goswin-v-b at web dot de changed:



   What|Removed |Added



 Status|RESOLVED|UNCONFIRMED

 Resolution|INVALID |



--- Comment #5 from Goswin von Brederlow goswin-v-b at web dot de 2013-03-25 
11:11:52 UTC ---

If it is invalid, as in not allowed, then I would expect an error. If it is

undefined behaviour then I would expect a warning.



For example:



register const int r4 asm(r4) = 0x1000;

Warning: const expression wont be bound to a specific register.


[Bug c++/56715] Explicit Reg Vars are being ignored for consts when using g++

2013-03-25 Thread jakub at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56715



Jakub Jelinek jakub at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||INVALID



--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org 2013-03-25 
11:22:53 UTC ---

But it isn't invalid, as in not allowed, just your assumptions about what it

does are wrong.


[Bug rtl-optimization/56719] New: missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread felix-gcc at fefe dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



 Bug #: 56719

   Summary: missed optimization: i  0x || i*4  0x

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: rtl-optimization

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: felix-...@fefe.de





This is the test code:



int foo(unsigned int i) {

  if (i  0x || i*4  0x)

baz();

}



gcc -O2 generates a cmp, a shift, and another cmp.



Why does this not generate a single cmp with 0x3fff?


[Bug rtl-optimization/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread ktietz at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



Kai Tietz ktietz at gcc dot gnu.org changed:



   What|Removed |Added



 CC||ktietz at gcc dot gnu.org



--- Comment #1 from Kai Tietz ktietz at gcc dot gnu.org 2013-03-25 11:41:15 
UTC ---

0x3fff is wrong as 0x3fff * 4 is just 0xfffc.  So proper optimization here is i

 0x3fffu.  That is a missed opportunity in VRP.


[Bug target/56720] New: ICE when expanding vcond with floating point unordered comparisons

2013-03-25 Thread ktkachov at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56720



 Bug #: 56720

   Summary: ICE when expanding vcond with floating point unordered

comparisons

Classification: Unclassified

   Product: gcc

   Version: 4.9.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: target

AssignedTo: ktkac...@gcc.gnu.org

ReportedBy: ktkac...@gcc.gnu.org

Target: arm-none-eabi





Created attachment 29720

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29720

ICEing testcase



Compiling the attached testcase with:

-O1 -funsafe-math-optimizations -ftree-vectorize -mfpu=neon -mfloat-abi=hard

causes an ICE on arm-none-eabi



vcond.c: In function 'foo':

vcond.c:7:10: internal compiler error: in expand_insn, at optabs.c:8274

 w[i] = MAX (0.0f, w2[i]);

  ^

0x82f9c5 expand_insn(insn_code, unsigned int, expand_operand*)

$SOURCE/gcc/gcc/optabs.c:8274

0x83430f expand_vec_cond_expr(tree_node*, tree_node*, tree_node*, tree_node*,

rtx_def*)

$SOURCE/gcc/gcc/optabs.c:6777

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.



Looking at the vcond pattern in neon.md, the predicate for the

comparison operator (arm_comparison_operator) uses maybe_get_arm_condition_code

 which is not needed for vcond since we don't care about the ARM condition code

(we can handle all the comparison cases ourselves in the expander).



Changing the predicate to comparison_operator allows the expander to proceed

but it ICEs again because the pattern doesn't handle the floating point

unordered cases! (i.e. UNGT, UNORDERED, UNLE etc).



Adding support for the unordered cases is very similar to the aarch64 port

added here:

http://gcc.gnu.org/ml/gcc-patches/2013-01/msg00957.html





The given testcase works for 4.6 and 4.7 but can be easily made to ICE by

changing

#define MAX(a, b) (a  b ? a : b)

to

#define UNORD(a, b) (__builtin_isunordered (a, b) ? a : b)

causing an ICE again because the code doesn't handle the unordered cases

properly.



I've got a patch to fix it for current trunk.


[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||missed-optimization

 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

  Component|rtl-optimization|middle-end

 Ever Confirmed|0   |1



--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
12:21:21 UTC ---

I don't think this has anything to do with VRP.  VRP does not propagate

backwards, that is, optimize away the first compare in



  if (i  0x)

if (i*4  0x)



from ranges derived from a compare following it.



This is a missed optimization in fold instead.  Not sure if practically

relevant though.


[Bug target/56720] ICE when expanding vcond with floating point unordered comparisons

2013-03-25 Thread ktkachov at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56720



--- Comment #1 from ktkachov at gcc dot gnu.org 2013-03-25 12:23:25 UTC ---

Created attachment 29721

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29721

Patch to fix ICE on trunk



Patch fixing bug on trunk.



Will test to ensure it fixes the issue on 4.6, 4.7, 4.8



gcc/ChangeLog

2013-03-25  Kyrylo Tkachov  kyrylo.tkac...@arm.com



* config/arm/iterators.md (v_cmp_result): New mode attribute.

* config/arm/neon.md (vcondmodemode): Handle unordered cases.





gcc/testsuite/ChangeLog

2013-03-25  Kyrylo Tkachov  kyrylo.tkac...@arm.com



* gcc.target/arm/neon-vcond-gt.c: New test.

* gcc.target/arm/neon-vcond-ltgt.c: Likewise.

* gcc.target/arm/neon-vcond-unordered.c: Likewise.


[Bug c++/56694] [4.8/4.9 Regression] Internal compiler error when compiling OpenMP code

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56694



--- Comment #6 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
12:28:55 UTC ---

Reduced testcase:



class GException {

public:

class vector_mismatch {

public:

vector_mismatch(int size1, int size2);

};

};

class GVector{

public:

GVector operator+=(const GVector v);

int m_num;

double* m_data;

};

inline GVector GVector::operator+= (const GVector v)

{

  if (m_num != v.m_num)

throw GException::vector_mismatch(m_num, v.m_num);

  for (int i = 0; i  m_num; ++i)  m_data[i] += v.m_data[i];

};

void eval(GVector* m_gradient, GVector* vect_cpy_grad, int n)

{

#pragma omp sections

{

  for (int i = 0; i  n; ++i)

*m_gradient += vect_cpy_grad[i];

}

}


[Bug c++/56694] [4.8/4.9 Regression] Internal compiler error when compiling OpenMP code

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56694



--- Comment #7 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
12:49:34 UTC ---

It's the lower RESX pass that causes the location to appear.  And likely

bogus locations in the EH on-the-side info:



  x = gimple_build_call (fn, 0);

  gimple_set_location (x, dst_r-u.must_not_throw.failure_loc);



thus, the must_not_throw failure_loc either shouldn't have a BLOCK associated

or it needs re-mapping during inlining / cloning.



Using LOCATION_LOCUS above fixes the ICE.


[Bug other/56721] New: libffi.info installed in share/info collides with that from libffi itself

2013-03-25 Thread howarth at nitro dot med.uc.edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56721



 Bug #: 56721

   Summary: libffi.info installed in share/info collides with that

from libffi itself

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: other

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: howa...@nitro.med.uc.edu





The libffi in gcc 4.8.0 installs a libffi.info file in share/info which

collides with that from a standalone installation of libffi. Is that intended?


[Bug other/56721] libffi.info installed in share/info collides with that from libffi itself

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56721



--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
12:53:09 UTC ---

Kind of.  The default install target should not install libffi.  See the

patch posted by Matthias Klose.


[Bug middle-end/35308] Straight line strength reduction

2013-03-25 Thread wschmidt at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35308



William J. Schmidt wschmidt at gcc dot gnu.org changed:



   What|Removed |Added



   Target Milestone|4.8.1   |4.9.0



--- Comment #5 from William J. Schmidt wschmidt at gcc dot gnu.org 2013-03-25 
13:17:39 UTC ---

The unknown stride features made it into 4.8.0, but conditional candidates are

still pending, and too complex for 4.8.1, I think.  Changing target to 4.9 for

the remaining work.  I do plan to get that wrapped up fairly soon.


[Bug bootstrap/56689] [4.9 Regression] internal compiler error: in get_loop_body, at cfgloop.c:841

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56689



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED



--- Comment #6 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
13:20:54 UTC ---

Author: rguenth

Date: Mon Mar 25 12:54:56 2013

New Revision: 197039



URL: http://gcc.gnu.org/viewcvs?rev=197039root=gccview=rev

Log:

2013-03-25  Richard Biener  rguent...@suse.de



PR tree-optimization/56689

* tree-vrp.c (execute_vrp): Mark loops for fixup if we removed

any edge.



* gcc.dg/torture/pr56689.c: New testcase.



Added:

trunk/gcc/testsuite/gcc.dg/torture/pr56689.c

Modified:

trunk/gcc/ChangeLog

trunk/gcc/testsuite/ChangeLog

trunk/gcc/tree-vrp.c


[Bug middle-end/54563] [4.7 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED



--- Comment #13 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
13:30:57 UTC ---

Fixed.


[Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.

2013-03-25 Thread bangerth at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415



--- Comment #9 from Wolfgang Bangerth bangerth at gmail dot com 2013-03-25 
13:50:00 UTC ---

Vikas: This was fixed in GCC in 2008. The version of GCC you are using (3.4.6)

was released in 2006 and the entire 3.4.x tree is in fact from 2004. It is time

for you to upgrade your system after almost a decade if there are features you

need.


[Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.

2013-03-25 Thread redi at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415



--- Comment #10 from Jonathan Wakely redi at gcc dot gnu.org 2013-03-25 
14:15:17 UTC ---

And please don't use Bugzilla for questions about using GCC, use the gcc-help

mailing list, thanks.


[Bug bootstrap/50686] [4.7 regression] IRIX 6.5 bootstrap failure: ICE in in lookup_cfa_1, at dwarf2cfi.c:595

2013-03-25 Thread ro at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50686



Rainer Orth ro at gcc dot gnu.org changed:



   What|Removed |Added



 Status|RESOLVED|REOPENED

 Resolution|FIXED   |



--- Comment #33 from Rainer Orth ro at gcc dot gnu.org 2013-03-25 14:18:21 
UTC ---

Unfortunately, after 20130111 (r195101), IRIX 6.5 bootstrap started failing

again:



/vol/gcc/src/hg/gcc-4.7-branch/local/libstdc++-v3/libsupc++/vec.cc: In function

'void __cxxabiv1::__cxa_vec_delete2(void*, std::size_t, std::size_t,

__cxxabiv1:

:__cxa_cdtor_type, void (*)(void*))':

/vol/gcc/src/hg/gcc-4.7-branch/local/libstdc++-v3/libsupc++/vec.cc:323:3:

intern

al compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2231



  Rainer


[Bug other/56721] libffi.info installed in share/info collides with that from libffi itself

2013-03-25 Thread howarth at nitro dot med.uc.edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56721



--- Comment #2 from Jack Howarth howarth at nitro dot med.uc.edu 2013-03-25 
14:24:55 UTC ---

Will http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00853.html go into both gcc

4.9 and 4.8.1?


[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread felix-gcc at fefe dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



--- Comment #3 from felix-gcc at fefe dot de 2013-03-25 14:41:10 UTC ---

@comment 1: maybe it's me but that does not make any sense.  3fff is wrong and

the correct value is 3fff?  Huh?



@comment 2: I extracted this code from a piece of commercial production

software compiled with gcc.  Not sure where you draw the line but to me that

makes it relevant :-)


[Bug c++/56694] [4.8/4.9 Regression] Internal compiler error when compiling OpenMP code

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56694



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED

  Known to fail||4.8.0



--- Comment #8 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
14:54:26 UTC ---

Author: rguenth

Date: Mon Mar 25 14:46:08 2013

New Revision: 197047



URL: http://gcc.gnu.org/viewcvs?rev=197047root=gccview=rev

Log:

2013-03-25  Richard Biener  rguent...@suse.de



PR middle-end/56694

* tree-eh.c (lower_eh_must_not_throw): Strip BLOCKs from the

must-not-throw stmt location.



* g++.dg/torture/pr56694.C: New testcase.



Added:

trunk/gcc/testsuite/g++.dg/torture/pr56694.C

Modified:

trunk/gcc/ChangeLog

trunk/gcc/testsuite/ChangeLog

trunk/gcc/tree-eh.c



Author: rguenth

Date: Mon Mar 25 14:47:56 2013

New Revision: 197048



URL: http://gcc.gnu.org/viewcvs?rev=197048root=gccview=rev

Log:

2013-03-25  Richard Biener  rguent...@suse.de



PR middle-end/56694

* tree-eh.c (lower_eh_must_not_throw): Strip BLOCKs from the

must-not-throw stmt location.



* g++.dg/torture/pr56694.C: New testcase.



Added:

branches/gcc-4_8-branch/gcc/testsuite/g++.dg/torture/pr56694.C

Modified:

branches/gcc-4_8-branch/gcc/ChangeLog

branches/gcc-4_8-branch/gcc/testsuite/ChangeLog

branches/gcc-4_8-branch/gcc/tree-eh.c


[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org 2013-03-25 
14:55:45 UTC ---

(In reply to comment #3)

 @comment 2: I extracted this code from a piece of commercial production

 software compiled with gcc.  Not sure where you draw the line but to me that

 makes it relevant :-)



Did it occur in this simplified form, that is, as a single if statement?


[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread felix-gcc at fefe dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



--- Comment #5 from felix-gcc at fefe dot de 2013-03-25 15:06:02 UTC ---

Yes.  However I'd hope that fixing this case would mean that gcc also catches

the case where it is split to multiple if statements.



I think this statement came about because they had a range check and someone

pointed out that checking foo*40x could be circumvented via an integer

overflow if foo is untrusted and very large.



There are smarter ways to do this but it's not completely mind-bogglingly

incomprehensible why this code would come about.



I have in fact been advocating for a while that programmers should rather spell

out their security checks as plainly as possible and let the compiler optimize

them and remove superfluous checks.  See



  http://www.fefe.de/source-code-optimization.pdf



if you are interested.


[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread jakub at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org 2013-03-25 
15:25:53 UTC ---

This actually isn't about optimizing away the first compare, but about merging

the two conditions into one that is equivalent to those two ored together.

The first condition is for range of i [0x1U, 0xU] while the latter

for ranges [0x4000U, 0x3fffU] or [0x40004000U, 0x7fffU] or

[0x80004000U, 0xbfffU] or [0xc0004000U, 0xfffU], and all the 5 ranges

together are

[0x4000U, 0xU].

Perhaps optimize_range_tests (or its fold-const.c counterpart) could both do

it, but the really ugly thing is that either we'd need to expand i*4 into 4

range tests and teach the code that those 4 are really already represented by

one range tests and thus an optimization would be only if we can even fewer

range tests than that (with some cap on number of ranges we'd generate, like

8-16 or so), or have some way to mark some range fuzzy (i.e. in that range we

don't know if it is in the range or out of it), and represent i*4  0xU as

[0x4000, 0x3fffU] range ored with fuzzy range [0x40004000U, 0xU].

Fuzzy range would then be treated for | as only optimizable if other non-fuzzy

ranges together completely cover that range (and for  that non-fuzzy ranges

anded together don't cover any of the values in the fuzzy range).



Anyway, I agree with Richard that it is questionable how often this would

actually hit in real-world code, i.e. whether this really is something to spend

lots of work on.


[Bug fortran/47034] TRANSFER of C_PTR: Components of structure constructor are PRIVATE

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47034



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:26 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/50612] C_FUNLOC takes the wrong address (result variable not function address)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50612



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:32 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/47023] C_Sizeof: Rejects valid code

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #26 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:38 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/38813] ICE with C_LOC(array)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38813



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #8 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:43 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/40963] ICE segfault - c_loc with derived type component as argument

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40963



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org

  Known to fail||



--- Comment #7 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:47 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR 

[Bug fortran/38894] c_f_procpointer/c_f_pointer - add missing argument checking

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38894



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #10 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:52 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/50269] Wrongly rejects element of assumed-shape array in C_LOC

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50269



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:53:57 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/39288] Bind(C): C_LOC of character substrings (F2003 erratum, pending)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39288



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:06 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/38536] ICE with C_LOC in resolve.c due to not properly going through expr-ref

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38536



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #24 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:01 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/54263] C_F_POINTER wrongly accepts a SHAPE= for scalar pointers

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54263



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:11 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/49023] ICE on invalid code with C_ASSOCIATED

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49023



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:17 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/52426] ICE for c_loc with array constructor

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52426



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:22 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/55444] Rejects valid code with USE ISO_C_BINDING in BLOCK DATA

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55444



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:26 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/55574] [4.7/4.8/4.9 Regression] C binding access to c_ptr type

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55574



--- Comment #4 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:31 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* gfortran.dg/c_assoc_2.f03: Update dg-error wording.

* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.

* 

[Bug fortran/56079] [4.7/4.8/4.9 Regression] ICE with C_PTR renaming and TRANSFER

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56079



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #6 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:36 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/55343] Renamed C_PTR entities are not treated as equivalent types.

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55343



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:40 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/56378] [4.6/4.7/4.8/4.9 Regression] ICE with C_LOC

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56378



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #9 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:45 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR 

[Bug fortran/45824] Update expr.c's check_inquiry for C_SIZEOF, compiler_version/_options, etc.

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45824



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
15:54:49 UTC ---

Author: burnus

Date: Mon Mar 25 15:40:26 2013

New Revision: 197053



URL: http://gcc.gnu.org/viewcvs?rev=197053root=gccview=rev

Log:

2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* check.c (gfc_var_strlen): Properly handle 0-sized string.

(gfc_check_c_sizeof): Use is_c_interoperable, add checks.

(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New

functions.

* expr.c (check_inquiry): Add c_sizeof, compiler_version and

compiler_options.

(gfc_check_pointer_assign): Refine function result check.

gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,

GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,

GFC_ISYM_C_LOC.

(iso_fortran_env_symbol, iso_c_binding_symbol): Handle

NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Update prototype.

(get_iso_c_sym): Remove.

(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.

* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.

(gfc_intrinsic_sub_interface): Use it.

(add_functions, add_subroutines): Add missing C-binding intrinsics.

(gfc_intrinsic_func_interface): Add special case for c_loc.

gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.

(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.

* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,

gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,

gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.

* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New

functions.

* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and

NAMED_FUNCTION.

* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.

* module.c (create_intrinsic_function): Support subroutines and

derived-type results.

(use_iso_fortran_env_module): Update calls.

(import_iso_c_binding_module): Ditto; update calls to

generate_isocbinding_symbol.

* resolve.c (find_arglists): Skip for intrinsic symbols.

(gfc_resolve_intrinsic): Find intrinsic subs via id.

(is_scalar_expr_ptr, gfc_iso_c_func_interface,

set_name_and_label, gfc_iso_c_sub_interface): Remove.

(resolve_function, resolve_specific_s0): Remove calls to those.

(resolve_structure_cons): Fix handling.

* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr

generation.

(gen_cptr_param, gen_fptr_param, gen_shape_param,

build_formal_args, get_iso_c_sym): Remove.

(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.

(generate_isocbinding_symbol): Support hidden symbols and

using c_ptr/c_funptr symtrees for nullptr defs.

* target-memory.c (gfc_target_encode_expr): Fix handling

of c_ptr/c_funptr.

* trans-expr.c (conv_isocbinding_procedure): Remove.

(gfc_conv_procedure_call): Remove call to it.

(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling

of c_ptr/c_funptr.

* trans-intrinsic.c (conv_isocbinding_function,

conv_isocbinding_subroutine): New.

(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):

Call them.

* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.

* trans-types.c (gfc_typenode_for_spec,

gfc_get_derived_type): Ditto.

(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.



2013-03-25  Tobias Burnus  bur...@net-b.de



PR fortran/38536

PR fortran/38813

PR fortran/38894

PR fortran/39288

PR fortran/40963

PR fortran/45824

PR fortran/47023

PR fortran/47034

PR fortran/49023

PR fortran/50269

PR fortran/50612

PR fortran/52426

PR fortran/54263

PR fortran/55343

PR fortran/55444

PR fortran/55574

PR fortran/56079

PR fortran/56378

* gfortran.dg/c_assoc_2.f03: Update dg-error wording.

* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.

* 

[Bug middle-end/56719] missed optimization: i 0xffff || i*4 0xffff

2013-03-25 Thread felix-gcc at fefe dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719



--- Comment #7 from felix-gcc at fefe dot de 2013-03-25 16:01:14 UTC ---

I filed this bug because I was under the impression that gcc was already

supposed to optimize this out as part of the value range optimizations.



You probably know better than me whether the required effort would be

disproportionate.  I'd still vote for supporting this case because then I can

go around and tell people to worry about writing readable code instead of

worrying about code that the compiler will compile well.


[Bug c++/56722] New: C++11: syntax error in for loop ends in SEGV

2013-03-25 Thread akim.demaille at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56722



 Bug #: 56722

   Summary: C++11: syntax error in for loop ends in SEGV

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c++

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: akim.demai...@gmail.com





Probably because of Boost.Foreach, I had a comma instead of a colon to separate

the iteration variable from the range.  GCC did not like that.



$ cat segv.cc

int main()

{

  for (const auto i, 21)

i;

}



$ g++-mp-4.8 -Wall -std=c++11 segv.cc

segv.cc: In function 'int main()':

segv.cc:3:20: internal compiler error: Segmentation fault: 11

   for (const auto i, 21)

^



segv.cc:3:20: internal compiler error: Abort trap: 6

g++-mp-4.8: internal compiler error: Abort trap: 6 (program cc1plus)

zsh: abort  g++-mp-4.8 -Wall -std=c++11 segv.cc



$ g++-mp-4.8 --version

g++-mp-4.8 (MacPorts gcc48 4.8-20130321_0) 4.8.0 20130321 (prerelease)

Copyright (C) 2013 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


[Bug c++/56722] C++11: syntax error in for loop ends in SEGV

2013-03-25 Thread redi at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56722



Jonathan Wakely redi at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||ice-on-invalid-code

 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

 Ever Confirmed|0   |1


[Bug fortran/47034] TRANSFER of C_PTR: Components of structure constructor are PRIVATE

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47034



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:43:07 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/50612] C_FUNLOC takes the wrong address (result variable not function address)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50612



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:43:57 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/47023] C_Sizeof: Rejects valid code

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED



--- Comment #27 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:46:24 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/38813] ICE with C_LOC(array)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38813



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #9 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:47:30 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/40963] ICE segfault - c_loc with derived type component as argument

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40963



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #8 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:48:34 UTC ---

FIXED on the 4.9 trunk.



Thanks for the report - and sorry for taking that long to fix it.


[Bug fortran/38894] c_f_procpointer/c_f_pointer - add missing argument checking

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38894



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED



--- Comment #11 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:48:57 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/50269] Wrongly rejects element of assumed-shape array in C_LOC

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50269



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #4 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:49:21 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/39288] Bind(C): C_LOC of character substrings (F2003 erratum, pending)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39288



--- Comment #4 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:50:29 UTC ---

FIXED on the 4.9 trunk.



(Actually, most cases worked before.)


[Bug fortran/39288] Bind(C): C_LOC of character substrings (F2003 erratum, pending)

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39288



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #5 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:50:46 UTC ---

really close as FIXED


[Bug fortran/54263] C_F_POINTER wrongly accepts a SHAPE= for scalar pointers

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54263



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:51:00 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/49023] ICE on invalid code with C_ASSOCIATED

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49023



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:51:22 UTC ---

FIXED on the 4.9 trunk.



Thanks for the report.


[Bug fortran/52426] ICE for c_loc with array constructor

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52426



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:52:11 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/55444] Rejects valid code with USE ISO_C_BINDING in BLOCK DATA

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55444



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:52:37 UTC ---

FIXED on the 4.9 trunk.


[Bug fortran/55343] Renamed C_PTR entities are not treated as equivalent types.

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55343



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:53:02 UTC ---

FIXED on the 4.9 trunk.



Thanks for the report.


[Bug fortran/38536] ICE with C_LOC in resolve.c due to not properly going through expr-ref

2013-03-25 Thread burnus at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38536



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #25 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-25 
17:56:11 UTC ---

FIXED on the 4.9 trunk.



I think all remaining issues are now fixed. Regarding the string length: Only

character(len=1) is interoperable, using a substring doesn't make it valid.

However, for C_LOC even Fortran 2003 (since Technical Corrigendum 5) allows

character(kind=C_char) with len  1.


[Bug c++/56722] C++11: syntax error in for loop ends in SEGV

2013-03-25 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56722



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|NEW |ASSIGNED

 AssignedTo|unassigned at gcc dot   |paolo.carlini at oracle dot

   |gnu.org |com



--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2013-03-25 
18:22:57 UTC ---

Mine.


[Bug bootstrap/54659] [4.8 Regression] Bootstrap with --disable-nls broken under Windows

2013-03-25 Thread josuegomes at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54659



--- Comment #14 from Josue Andrade Gomes josuegomes at gmail dot com 
2013-03-25 18:30:40 UTC ---

Not fixed. Still reproducible with final 4.8.0

See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56644


[Bug c++/56723] New: wrong location in error message

2013-03-25 Thread tromey at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56723

 Bug #: 56723
   Summary: wrong location in error message
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: tro...@gcc.gnu.org


Consider this source file:

int f (int *);

int callf (int, int, int (*)(double *));

int docall(void)
{
  return callf (23, 72,
f);
}


Compiling this with g++ yields:

t.cc: In function ‘int docall()’:
t.cc:8:4: error: invalid conversion from ‘int (*)(int*)’ to ‘int (*)(double*)’
[-fpermissive]
   f);
^
t.cc:3:5: error:   initializing argument 3 of ‘int callf(int, int, int
(*)(double*))’ [-fpermissive]
 int callf (int, int, int (*)(double *));
 ^


Note that 8:4 location.
I think this is slightly off.

The C compiler gets it ok:

barimba. gcc -g --syntax-only t.c
t.c: In function ‘docall’:
t.c:8:3: warning: passing argument 3 of ‘callf’ from incompatible pointer type
[enabled by default]
(etc)

[Bug c/56724] New: sub-optimal location in error

2013-03-25 Thread tromey at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56724

 Bug #: 56724
   Summary: sub-optimal location in error
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: tro...@gcc.gnu.org


Consider this source:

int f (int *);

int callf (int, int, int (*)(double *));

int docall(void)
{
  return callf (23, 72,
f);
}


Compiling this, I get:

t.c: In function ‘docall’:
t.c:8:3: warning: passing argument 3 of ‘callf’ from incompatible pointer type
[enabled by default]
   f);
   ^
t.c:3:5: note: expected ‘int (*)(double *)’ but argument is of type ‘int
(*)(int *)’
 int callf (int, int, int (*)(double *));
 ^


I think the location 3:5 is not ideal.
It would be better, at least IMO, if it pointed to the particular
parameter in the declaration.
If you have many parameters, it can be hard to find the right one.

[Bug c++/56725] New: extra spaces in error message

2013-03-25 Thread tromey at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56725

 Bug #: 56725
   Summary: extra spaces in error message
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: tro...@gcc.gnu.org


Consider this source:

int f (int *);

int callf (int, int, int (*)(double *));

int docall(void)
{
  return callf (23, 72,
f);
}


If I compile this with g++ I get:

t.c: In function ‘int docall()’:
t.c:8:4: error: invalid conversion from ‘int (*)(int*)’ to ‘int (*)(double*)’
[-fpermissive]
   f);
^
t.c:3:5: error:   initializing argument 3 of ‘int callf(int, int, int
(*)(double*))’ [-fpermissive]
 int callf (int, int, int (*)(double *));
 ^
You have mail in /var/spool/mail/tromey


Note the extra spaces before initializing.
This looked weird to me.

[Bug c/56724] sub-optimal location in error

2013-03-25 Thread tromey at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56724



--- Comment #1 from Tom Tromey tromey at gcc dot gnu.org 2013-03-25 18:44:37 
UTC ---

This affects g++ as well.


[Bug c/56724] sub-optimal location in error

2013-03-25 Thread pinskia at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56724

--- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2013-03-25 
18:45:24 UTC ---
(In reply to comment #0)
 t.c: In function ‘docall’:
 t.c:8:3: warning: passing argument 3 of ‘callf’ from incompatible pointer type
 [enabled by default]

 If you have many parameters, it can be hard to find the right one.

Though it does say the 3rd argument though.

[Bug c++/56723] wrong location in error message

2013-03-25 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56723



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

 Ever Confirmed|0   |1



--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2013-03-25 
18:46:46 UTC ---

Unfortunately, only by chance slightly: AFAICS the column is at the closing

round bracket. Compare:



int f (int *);



int callf (int (*)(double *), int, int);



int docall(void)

{

  return callf (f, 23, 72);

}


[Bug c/56724] sub-optimal location in error

2013-03-25 Thread tromey at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56724



--- Comment #3 from Tom Tromey tromey at gcc dot gnu.org 2013-03-25 18:46:47 
UTC ---

(In reply to comment #2)



 Though it does say the 3rd argument though.



Sure, it is just nicer if the compiler counts commas instead of me doing it.


[Bug target/56726] New: i386: MALLOC_ABI_ALIGNMENT is too small (usually)

2013-03-25 Thread chip at pobox dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56726



 Bug #: 56726

   Summary: i386: MALLOC_ABI_ALIGNMENT is too small (usually)

Classification: Unclassified

   Product: gcc

   Version: 4.9.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: target

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: c...@pobox.com





Observed malloc alignment for the i386 ABI is double POINTER_SIZE. 

BITS_PER_WORD, the current default, is usually too small.  (It's right only on

X32.)



Proposed patch:



--- gcc/config/i386/i386.h  (revision 197055)

+++ gcc/config/i386/i386.h  (working copy)

@@ -815,6 +815,14 @@

x86_field_alignment (FIELD, COMPUTED)

 #endif



+/* The maximum alignment 'malloc' honors.

+

+   This value is taken from glibc documentation for memalign().  It may

+   be up to double the very conservative GCC default.  This should be safe,

+   since even the GCC 4.8 default of BIGGEST_ALIGNMENT usually worked.  */

+

+#define MALLOC_ABI_ALIGNMENT (POINTER_SIZE * 2)

+

 /* If defined, a C expression to compute the alignment given to a

constant that is being placed in memory.  EXP is the constant

and ALIGN is the alignment that the object would ordinarily have


[Bug rtl-optimization/56434] document that __attribute__((__malloc__)) assumes returned pointer has BIGGEST_ALIGNMENT

2013-03-25 Thread chip at pobox dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56434



--- Comment #12 from Chip Salzenberg chip at pobox dot com 2013-03-25 
19:15:10 UTC ---

Thank you.  I've filed #56726 with a patch to update MALLOC_ABI_ALIGNMENT on

i386.


[Bug c/56727] New: [4.7/4.8] [missed-optimization] Recursive call goes through the PLT unnecessarily

2013-03-25 Thread thiago at kde dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727



 Bug #: 56727

   Summary: [4.7/4.8] [missed-optimization] Recursive call goes

through the PLT unnecessarily

Classification: Unclassified

   Product: gcc

   Version: 4.7.2

Status: UNCONFIRMED

  Severity: minor

  Priority: P3

 Component: c

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: thi...@kde.org





Consider the following code, compiled with -O2 -fPIC either in C or in C++:



===

void f(TYPE b)

{

f(0);

}

===



if TYPE is a type of 32- or 64-bit width (int, unsigned, long, long long), GCC

generates the following code (-m32, -mx32 or -m64):



===

f:

.L2:

jmp .L2

===



If TYPE is shorter than 32-bit (bool, _Bool, char, short), GCC generates the

following code (-mx32, -m64):



===

f:

xorl%edi, %edi

jmp f@PLT

===



and much worse code for -m32.



For whatever reason, GCC decided to place the call via the PLT. That's a the

missed optimisation: if this function was called, then the PLT must resolve

back to itself. What's more, since the argument wasn't used, it's also

unnecessary to set it.



The output happens without -fPIC, but in that case there is no PLT.



Tested on:

  GCC 4.7.2 (as shipped by Fedora 17)

  GCC 4.9 (trunk build from 20130318)



This is a contrived example (infinite recursion) that no one would write in

their sane mind. But it might point to missed optimisations in legitimate

recursive functions.


[Bug middle-end/56727] [4.7/4.8] [missed-optimization] Recursive call goes through the PLT unnecessarily

2013-03-25 Thread pinskia at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727



Andrew Pinski pinskia at gcc dot gnu.org changed:



   What|Removed |Added



  Component|c   |middle-end



--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org 2013-03-25 
19:18:17 UTC ---

This is due to promoting of the type to int on some targets (x86 is the main

one).


[Bug target/56726] i386: MALLOC_ABI_ALIGNMENT is too small (usually)

2013-03-25 Thread hjl.tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56726



H.J. Lu hjl.tools at gmail dot com changed:



   What|Removed |Added



 CC||hjl.tools at gmail dot com



--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2013-03-25 20:04:44 
UTC ---

(In reply to comment #0)

 Observed malloc alignment for the i386 ABI is double POINTER_SIZE. 

 BITS_PER_WORD, the current default, is usually too small.  (It's right only on

 X32.)

 

 Proposed patch:

 

 --- gcc/config/i386/i386.h  (revision 197055)

 +++ gcc/config/i386/i386.h  (working copy)

 @@ -815,6 +815,14 @@

 x86_field_alignment (FIELD, COMPUTED)

  #endif

 

 +/* The maximum alignment 'malloc' honors.

 +

 +   This value is taken from glibc documentation for memalign().  It may

 +   be up to double the very conservative GCC default.  This should be safe,

 +   since even the GCC 4.8 default of BIGGEST_ALIGNMENT usually worked.  */

 +

 +#define MALLOC_ABI_ALIGNMENT (POINTER_SIZE * 2)

 +



This isn't correct for x32, whose pointer size is 4 bytes with malloc

aligned to 16 bytes.


[Bug fortran/52512] Cannot match namelist object name

2013-03-25 Thread t...@tilo-schwarz.de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52512



Tilo Schwarz t...@tilo-schwarz.de changed:



   What|Removed |Added



 CC||t...@tilo-schwarz.de



--- Comment #5 from Tilo Schwarz t...@tilo-schwarz.de 2013-03-25 20:13:56 UTC 
---

Author: tiloschwarz

Date: Mon Mar 25 20:11:20 2013

New Revision: 197061



URL: http://gcc.gnu.org/viewcvs?rev=197061root=gccview=rev

Log:

2013-03-25  Tilo Schwarz  t...@tilo-schwarz.de



PR libfortran/52512

* io/list_read.c (nml_parse_qualifier): To check for a derived type

don't use the namelist head element type but the current element type.

(nml_get_obj_data): Add current namelist element type to

nml_parse_qualifier call.



2013-03-25  Tilo Schwarz  t...@tilo-schwarz.de



PR libfortran/52512

* gfortran.dg/namelist_79.f90: New.





Added:

trunk/gcc/testsuite/gfortran.dg/namelist_79.f90

Modified:

trunk/gcc/testsuite/ChangeLog

trunk/libgfortran/ChangeLog

trunk/libgfortran/io/list_read.c


[Bug c++/56728] New: ICE using constexpr initialization and arrays

2013-03-25 Thread npl at chello dot at


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56728



 Bug #: 56728

   Summary: ICE using constexpr initialization and arrays

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c++

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: n...@chello.at





Created attachment 29722

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29722

code to raise the ICE



gcc 4.8.0 raises an ICE when fed with the provided code, while gcc 4.7.2 has no

problems.

removing either of the constexpr fixes the issue, and one of them probably

shouldnt pass as constexpr in the first place (Im not really adept at

interpreting the official C++11 standard but AFAIR reinterpret casts arent

allowed?)







internal compiler error: in gimple_expand_cfg, at cfgexpand.c:4575



--

used gcc:

Using built-in specs.

COLLECT_GCC=./tc/bin/arm-none-eabi-g++

COLLECT_LTO_WRAPPER=/opt/tc48/libexec/gcc/arm-none-eabi/4.8.0/lto-wrapper

Target: arm-none-eabi

Configured with: /opt/tc48/src/gcc-4.8.0/configure --prefix=/opt/tc48

--target=arm-none-eabi --enable-languages=c,c++ --disable-libstdcxx-verbose

--disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-multilib

--disable-shared --disable-nls --with-system-zlib --enable-tls --enable-gold

--with-gnu-as --with-gnu-ld --enable-lto --with-newlib

--with-gmp=/home/tcbuild/toolchain-make/build/ggcnativebuild/gmp-5.1.1

--with-mpfr=/home/tcbuild/toolchain-make/build/ggcnativebuild/mpfr-3.1.2

--with-mpc=/home/tcbuild/toolchain-make/build/ggcnativebuild/mpc-1.0.1

--with-cloog=/home/tcbuild/toolchain-make/build/ggcnativebuild/cloog-0.18.0

--with-isl=/home/tcbuild/toolchain-make/build/ggcnativebuild/isl-0.11.1

--with-host-libstdcxx='-Wl,-Bstatic,/usr/lib/gcc/i486-linux-gnu/4.4.5/libstdc++.a,/usr/lib/gcc/i486-linux-gnu/4.4.5/libsupc++.a,-Bdynamic

-lm'

Thread model: single

gcc version 4.8.0 (GCC)


[Bug c++/52014] [c++0x] Segfault When `decltype` Used in Nested Lambda Function Defined in Class Member Function

2013-03-25 Thread jason at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52014



Jason Merrill jason at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 CC||jason at gcc dot gnu.org

 Resolution||FIXED

 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org

   |gnu.org |

   Target Milestone|--- |4.8.1



--- Comment #3 from Jason Merrill jason at gcc dot gnu.org 2013-03-25 
20:39:30 UTC ---

Fixed for 4.8.1.


[Bug c++/56722] C++11: syntax error in for loop ends in SEGV

2013-03-25 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56722



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.8.1



--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com 2013-03-25 
20:40:33 UTC ---

Fixed mainline and 4.8.1.


[Bug libgcj/54100] Problems building libjava on AIX 5.2

2013-03-25 Thread dje at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54100



David Edelsohn dje at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

 CC||dje at gcc dot gnu.org

 Ever Confirmed|0   |1



--- Comment #2 from David Edelsohn dje at gcc dot gnu.org 2013-03-25 20:40:56 
UTC ---

libjava does not build on AIX in general for other reasons.  But GCC 4.8 should

invoke the AIX assembler with -many to accept more, valid mnemonics.


[Bug c++/56728] [4.8/4.9 Regression] ICE using constexpr initialization and arrays

2013-03-25 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56728



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2013-03-25

   Target Milestone|--- |4.8.1

Summary|ICE using constexpr |[4.8/4.9 Regression] ICE

   |initialization and arrays   |using constexpr

   ||initialization and arrays

 Ever Confirmed|0   |1



--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2013-03-25 
20:42:43 UTC ---

Confirmed.


  1   2   >