public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc.
@ 2006-11-03 16:54 burnus at gcc dot gnu dot org
2006-11-03 17:03 ` [Bug fortran/29697] " burnus at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-03 16:54 UTC (permalink / raw)
To: gcc-bugs
I came accross this when implementing the volatile statement/attribute
(PR29601), where I used:
> + if (sym->attr.volatile_)
> + TREE_THIS_VOLATILE (decl) = 1;
Ian Lance Taylor noted that:
"I think you will also want to give DECL a type which is
volatile-qualified:
build_qualified_type (original_type, TYPE_QUAL_VOLATILE)"
tree.h offers:
- TYPE_QUAL_CONST
- TYPE_QUAL_VOLATILE
- TYPE_QUAL_RESTRICT
whereas fortran only "uses":
DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
build_pointer_type
(build_qualified_type (void_type_node,
TYPE_QUAL_VOLATILE)))
I think TYPE_QUAL_CONST should be used for all PARAMETERs (unless I miss
something), maybe also for intent(in) pointers etc.
Currently, using "const int" in C gives in (-dump-tree-original) "const int"
whereas "integer, parameter ::" in Fortran only gives "int".
* * *
The meaning can be found in the C99 standard (6.7.3):
"An object that has volatile-qualified type may be modified in ways unknown to
the implementation or have other unknown side effects. Therefore any expression
referring to such an object shall be evaluated strictly according to the rules
of the abstract machine, as described in 5.1.2.3. Furthermore, at every
sequence point the value last stored in the object shall agree with that
prescribed by the abstract machine, except as modified by the unknown factors
mentioned previously.114) What constitutes an access to an object that
has volatile-qualified type is implementation-defined."
"An object that is accessed through a restrict-qualified pointer has a special
association with that pointer. This association, defined in 6.7.3.1 below,
requires that all accesses to that object use, directly or indirectly, the
value of that particular pointer.115) The intended use of the restrict
qualifier (like the register storage class) is to promote optimization, and
deleting all instances of the qualifier from all preprocessing translation
units composing a conforming program does not change its meaning (i.e.,
observable
behavior)." (And more detailed and formal in the paragraphs below.)
--
Summary: gfortran should use TYPE_QUAL_CONST etc.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
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=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
@ 2006-11-03 17:03 ` burnus at gcc dot gnu dot org
2006-11-03 17:26 ` burnus at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-03 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2006-11-03 17:03 -------
A good introduction into restricted can be found at
http://developers.sun.com/sunstudio/articles/cc_restrict.html
Maybe this is something for the array implementation in gfortran?
I don't fully understand how the data part of arrays are used, but I would
assume they are pointers where the "restricted" part is not given.
As Fortran requires "target" for arrays to which a pointer may point, it should
be easy to add "restricted" in the non-target case; according to the article it
helps the compiler quit a bit to optimize - as "const" does.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
2006-11-03 17:03 ` [Bug fortran/29697] " burnus at gcc dot gnu dot org
@ 2006-11-03 17:26 ` burnus at gcc dot gnu dot org
2006-11-03 18:03 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-03 17:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2006-11-03 17:26 -------
Andy pointed out that TYPE_QUAL_VOLATILE only changes the dumped string,
nonetheless it makes checking things easier, I think.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
2006-11-03 17:03 ` [Bug fortran/29697] " burnus at gcc dot gnu dot org
2006-11-03 17:26 ` burnus at gcc dot gnu dot org
@ 2006-11-03 18:03 ` pinskia at gcc dot gnu dot org
2006-11-07 14:24 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-03 18:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-11-03 18:03 -------
For arguments, you missed that flag_argument_noalias is set to 2 (or is it 3
now).
It also changes debugging info which is needed in this case to get the correct
debuging info.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |24546
nThis| |
Severity|enhancement |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-11-03 18:03 ` pinskia at gcc dot gnu dot org
@ 2006-11-07 14:24 ` burnus at gcc dot gnu dot org
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-07 14:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2006-11-07 14:24 -------
Note for completeness: With PR 29601 the TYPE_QUAL_VOLATILE is used for for
VOLATILE variables (see -fdump-tree-original; however, the word "volatile" does
not show up in the dump for pointers and arrays, even though they are treated
as volatile correctly; cf. gfortran.dg/volatile{6,7}.f90.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-11-07 14:24 ` burnus at gcc dot gnu dot org
@ 2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
2009-08-21 18:44 ` burnus at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 6:00 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-04-18 07:00:16
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
2009-08-21 18:44 ` burnus at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 6:00 UTC (permalink / raw)
To: gcc-bugs
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/29697] gfortran should use TYPE_QUAL_CONST etc.
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
` (5 preceding siblings ...)
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
@ 2009-08-21 18:44 ` burnus at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-08-21 18:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2009-08-21 18:44 -------
TYPE_QUAL_RESTRICT is now supported, see
http://gcc.gnu.org/ml/fortran/2009-08/msg00208.html
TYPE_QUAL_CONST is to my knowledge a no op, for QUAL_VOLATILE, I have not
checked whether it is already (correctly) used or not - according to comment 4
they are.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29697
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <bug-29697-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2013-06-25 9:05 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-03 16:54 [Bug fortran/29697] New: gfortran should use TYPE_QUAL_CONST etc burnus at gcc dot gnu dot org
2006-11-03 17:03 ` [Bug fortran/29697] " burnus at gcc dot gnu dot org
2006-11-03 17:26 ` burnus at gcc dot gnu dot org
2006-11-03 18:03 ` pinskia at gcc dot gnu dot org
2006-11-07 14:24 ` burnus at gcc dot gnu dot org
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
2007-04-18 6:00 ` fxcoudert at gcc dot gnu dot org
2009-08-21 18:44 ` burnus at gcc dot gnu dot org
[not found] <bug-29697-4@http.gcc.gnu.org/bugzilla/>
2013-06-25 9:05 ` dominiq at lps dot ens.fr
2013-06-25 9:05 ` 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).