public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/34446]  New: gnatprep evaluating "not" operator at incorrect precidence
@ 2007-12-12 20:55 repucul at link dot com
  2007-12-13 13:39 ` [Bug ada/34446] " sam at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: repucul at link dot com @ 2007-12-12 20:55 UTC (permalink / raw)
  To: gcc-bugs

The following is evaluated incorrectly with gnatprep 3.4.6
# if  not VAR_TRUE  or  VAR_TRUE  then
   ans := Good;
# else
   ans := Wrong;
# end if;

Using command:
  gnatprep -r -DVAR_TRUE=true thing.in thing.out
generates following results
--! # if  not VAR_TRUE  or  VAR_TRUE  then
--!    ans := Good;
--! # else
   ans := Wrong;
--! # end if;

An earlier version(3.3.3) of gnatprep produced correct results.


-- 
           Summary: gnatprep evaluating "not" operator at incorrect
                    precidence
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: repucul at link dot com


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
@ 2007-12-13 13:39 ` sam at gcc dot gnu dot org
  2007-12-13 23:28 ` ronald dot pucul at l-3com dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2007-12-13 13:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from sam at gcc dot gnu dot org  2007-12-13 13:39 -------
This is fixed in SVN trunk:

==============Error messages for input file: thing.in
     1. # if  not VAR_TRUE  or  VAR_TRUE  then
                            |
        >>> mixing "not" and "or" is not allowed, parentheses are required

 5 lines: 1 error


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
  2007-12-13 13:39 ` [Bug ada/34446] " sam at gcc dot gnu dot org
@ 2007-12-13 23:28 ` ronald dot pucul at l-3com dot com
  2007-12-14 23:13 ` bdavis at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ronald dot pucul at l-3com dot com @ 2007-12-13 23:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ronald dot pucul at l-3com dot com  2007-12-13 23:28 -------
Subject: RE:  gnatprep evaluating "not" operator at incorrect precidence

Sorry, I had assumed gnatprep would follow the same rules of precidence
as the ADA RM requires.
I had not known this not mixing of  "not" and "and" or "or" rule was
established.(operation changed someplace between 3.3.3 and 3.4.1)

On the version included with gcc-3.3.3 the gnatprep tool performs the
evaluation for "not" operator / keyword acording to the ADA RM
precidence.

The GNAT RM on gcc.gnu.org doesn't precicely indicate one way or other
how/when "not" should be evaluated.

I'll "patch" the gcc-3.4.6 version of gnatprep for our internal use
until the 2000+ lines(approx 400 source files) not currently following
the NEW rule are modified.

Thank You for the info.
Ron Pucul -- Old/tired sftwr. eng. here @ L3 Link.

> -----Original Message-----
> From: sam at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] 
> Sent: Thursday, December 13, 2007 7:40 AM
> To: Pucul, Ronald E. @ Link
> Subject: [Bug ada/34446] gnatprep evaluating "not" operator 
> at incorrect precidence
> 
> 
> 
> ------- Comment #1 from sam at gcc dot gnu dot org  
> 2007-12-13 13:39 ------- This is fixed in SVN trunk:
> 
> ==============Error messages for input file: thing.in
>      1. # if  not VAR_TRUE  or  VAR_TRUE  then
>                             |
>         >>> mixing "not" and "or" is not allowed, parentheses 
> are required
> 
>  5 lines: 1 error
> 
> 
> -- 
> 
> sam at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> --------------------------------------------------------------
> --------------
>              Status|UNCONFIRMED                 |RESOLVED
>          Resolution|                            |FIXED
>    Target Milestone|---                         |4.3.0
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34446
> 
> ------- You are receiving this mail because: ------- You are 
> on the CC list for the bug, or are watching someone who is.
> You reported the bug, or are watching the reporter.
> 


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
  2007-12-13 13:39 ` [Bug ada/34446] " sam at gcc dot gnu dot org
  2007-12-13 23:28 ` ronald dot pucul at l-3com dot com
@ 2007-12-14 23:13 ` bdavis at gcc dot gnu dot org
  2007-12-16 23:05 ` bdavis at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2007-12-14 23:13 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]



------- Comment #3 from bdavis at gcc dot gnu dot org  2007-12-14 23:13 -------
not sure i would call this one 'resolved'.

the gnat users manual does not document any such restriction:

----------------------------------------------------------------------

In this example, expression is defined by the following grammar:
      expression ::=  <symbol>
      expression ::=  <symbol> = "<value>"
      expression ::=  <symbol> = <symbol>
      expression ::=  <symbol> ’Defined
Chapter 16: Preprocessing Using gnatprep           193
     expression ::= not expression
     expression ::= expression and expression
     expression ::= expression or expression
     expression ::= expression and then expression
     expression ::= expression or else expression
     expression ::= ( expression )
-------------------------------------------------------------
since NOT VAR_TRUE is an EXPRESSION and an
expression can be an EXPRESSION or VAR_TRUE, it sure seems like it
should work as described.

the change that declares this an error is this one:

Revision 125441 - (view) (download) - [select for diffs]
Modified Wed Jun 6 10:40:36 2007 UTC (6 months, 1 week ago) by charlet
File length: 46257 byte(s)
Diff to previous 118249 (colored)

2007-04-20  Vincent Celier  <celier@adacore.com>

        * prep.ads, prep.adb (Expression): New Boolean parameter Complemented,
        defaulted to False.
        In the "not" case, recursive call with Complemented set to True.
        Do not allow "or" or "and" operators when Complemented is True.



i did not find any discussion on this on gcc-patches during april (but it was a
busy month, could have missed it).

i think this is a valid bug.  if gnatprep is supposed to have this limit, it
should be expressed in the users manual.  if it is not, then the code should be
changed to work as expected.

the request is very reasonable, and it used to work that way.  backwards
compatibility is important.  some would call this a regression.

regards,
bud davis


-- 

bdavis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.0                       |---


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
                   ` (2 preceding siblings ...)
  2007-12-14 23:13 ` bdavis at gcc dot gnu dot org
@ 2007-12-16 23:05 ` bdavis at gcc dot gnu dot org
  2008-05-28 15:57 ` charlet at gcc dot gnu dot org
  2008-05-28 15:58 ` charlet at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2007-12-16 23:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bdavis at gcc dot gnu dot org  2007-12-16 23:05 -------
re-opened pending additional comments.


-- 

bdavis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bdavis at gcc dot gnu dot
                   |                            |org
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
                   ` (3 preceding siblings ...)
  2007-12-16 23:05 ` bdavis at gcc dot gnu dot org
@ 2008-05-28 15:57 ` charlet at gcc dot gnu dot org
  2008-05-28 15:58 ` charlet at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-05-28 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from charlet at gcc dot gnu dot org  2008-05-28 15:56 -------
Subject: Bug 34446

Author: charlet
Date: Wed May 28 15:55:41 2008
New Revision: 136111

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136111
Log:
2008-05-28  Vincent Celier  <celier@adacore.com>

        PR ada/34446
        * gnat_ugn.texi: Document restriction introduced on 2007-04-20 in
        preprocessing expressions


Modified:
    trunk/gcc/ada/gnat_ugn.texi


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/34446] gnatprep evaluating "not" operator at incorrect precidence
  2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
                   ` (4 preceding siblings ...)
  2008-05-28 15:57 ` charlet at gcc dot gnu dot org
@ 2008-05-28 15:58 ` charlet at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-05-28 15:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from charlet at gcc dot gnu dot org  2008-05-28 15:58 -------
Documentation has been updated, so closing.


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-28 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-12 20:55 [Bug ada/34446] New: gnatprep evaluating "not" operator at incorrect precidence repucul at link dot com
2007-12-13 13:39 ` [Bug ada/34446] " sam at gcc dot gnu dot org
2007-12-13 23:28 ` ronald dot pucul at l-3com dot com
2007-12-14 23:13 ` bdavis at gcc dot gnu dot org
2007-12-16 23:05 ` bdavis at gcc dot gnu dot org
2008-05-28 15:57 ` charlet at gcc dot gnu dot org
2008-05-28 15:58 ` charlet at gcc dot gnu dot org

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).