public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals
@ 2010-06-21 7:02 burnus at gcc dot gnu dot org
2010-06-21 7:13 ` [Bug fortran/44604] " burnus at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-21 7:02 UTC (permalink / raw)
To: gcc-bugs
Reported by Michael Briggs at
http://gcc.gnu.org/ml/fortran/2010-06/msg00205.html
Checking fails for a zero-initialized pointers/allocatable scalar
variable/array element passed to a dummy argument with VALUE attribute.
For the following program, it fails for -fcheck=all:
program TestSmall
implicit none
integer, allocatable :: ptrVar
allocate ( ptrVar )
ptrVar = 0 ! if changed to 1, the problem goes away
call test(ptrVar)
contains
subroutine test(n)
integer, VALUE :: n
end subroutine test
end program TestSmall
--
Summary: Wrong run-time checks with VALUE dummies and
pointer/allocatable actuals
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44604
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/44604] Wrong run-time checks with VALUE dummies and pointer/allocatable actuals
2010-06-21 7:02 [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals burnus at gcc dot gnu dot org
@ 2010-06-21 7:13 ` burnus at gcc dot gnu dot org
2010-06-21 7:24 ` burnus at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-21 7:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2010-06-21 07:13 -------
Seemingly the allocated/associated check
cond = fold_build2 (EQ_EXPR, boolean_type_node, parmse.expr,
fold_convert (TREE_TYPE (parmse.expr),
null_pointer_node));
in trans-expr.c's gfc_conv_procedure_call accesses the value of the variable
and not its location as parmse.expr is already dereferenced via gfc_conv_expr,
called by
else if (fsym && fsym->attr.value)
{
// [...]
gfc_conv_expr (&parmse, e);
}
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44604
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/44604] Wrong run-time checks with VALUE dummies and pointer/allocatable actuals
2010-06-21 7:02 [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals burnus at gcc dot gnu dot org
2010-06-21 7:13 ` [Bug fortran/44604] " burnus at gcc dot gnu dot org
@ 2010-06-21 7:24 ` burnus at gcc dot gnu dot org
2010-06-21 8:55 ` dominiq at lps dot ens dot fr
2010-06-21 9:13 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-21 7:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2010-06-21 07:24 -------
Reminder: Same problem occurs when calling with %VAL(actual_arg).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44604
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/44604] Wrong run-time checks with VALUE dummies and pointer/allocatable actuals
2010-06-21 7:02 [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals burnus at gcc dot gnu dot org
2010-06-21 7:13 ` [Bug fortran/44604] " burnus at gcc dot gnu dot org
2010-06-21 7:24 ` burnus at gcc dot gnu dot org
@ 2010-06-21 8:55 ` dominiq at lps dot ens dot fr
2010-06-21 9:13 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-06-21 8:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dominiq at lps dot ens dot fr 2010-06-21 08:55 -------
Is it not a duplicate of pr35203?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44604
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/44604] Wrong run-time checks with VALUE dummies and pointer/allocatable actuals
2010-06-21 7:02 [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-06-21 8:55 ` dominiq at lps dot ens dot fr
@ 2010-06-21 9:13 ` burnus at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-21 9:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2010-06-21 09:13 -------
(In reply to comment #3)
> Is it not a duplicate of pr35203?
No. In this bug (PR 44604) one is in the caller and there one can distinguish
between address and value of a variable and the fix is relatively simple
(though requires some thinking and re-shoveling).
By contrast, PR 35203 requires a special handling of OPTIONAL + VALUE dummies,
where both the caller and the callee need to be involved by passing additional
information and making use of them.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44604
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <bug-44604-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2014-12-06 0:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21 7:02 [Bug fortran/44604] New: Wrong run-time checks with VALUE dummies and pointer/allocatable actuals burnus at gcc dot gnu dot org
2010-06-21 7:13 ` [Bug fortran/44604] " burnus at gcc dot gnu dot org
2010-06-21 7:24 ` burnus at gcc dot gnu dot org
2010-06-21 8:55 ` dominiq at lps dot ens dot fr
2010-06-21 9:13 ` burnus at gcc dot gnu dot org
[not found] <bug-44604-4@http.gcc.gnu.org/bugzilla/>
2013-06-11 20:24 ` dominiq at lps dot ens.fr
2013-06-17 15:05 ` dominiq at lps dot ens.fr
2014-12-06 0:09 ` dominiq at lps dot ens.fr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).