public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25206]  New: for loop with comma operator problem
@ 2005-12-01 14:46 ymonyak at lipowsky dot de
  2005-12-01 15:28 ` [Bug middle-end/25206] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ymonyak at lipowsky dot de @ 2005-12-01 14:46 UTC (permalink / raw)
  To: gcc-bugs

GCC 4.0.1 bilt by GNUARM.

follow source has different read and store address by incrementing of "n".
As result variable "n" will be not changed.

unsigned short CommTxNum;

static void foo (void) __attribute__ ((interrupt ("IRQ")));
void foo(void)
{
unsigned char n;

 for (n = 0; n < 3 && CommTxNum; n++, CommTxNum++)
 {
...
 }
}


-- 
           Summary: for loop with comma operator problem
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ymonyak at lipowsky dot de
 GCC build triplet: 4.0.1
  GCC host triplet: windows2000 sygwin
GCC target triplet: arm-elf


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


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

* [Bug middle-end/25206] for loop with comma operator problem
  2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
@ 2005-12-01 15:28 ` pinskia at gcc dot gnu dot org
  2005-12-01 15:55 ` efim at lipowsky dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-01 15:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-12-01 15:28 -------
HUH? Can you give the full source/ reduced source and give a little more
detailed explication on what is going wrong.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


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

* [Bug middle-end/25206] for loop with comma operator problem
  2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
  2005-12-01 15:28 ` [Bug middle-end/25206] " pinskia at gcc dot gnu dot org
@ 2005-12-01 15:55 ` efim at lipowsky dot de
  2005-12-01 16:00 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: efim at lipowsky dot de @ 2005-12-01 15:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from efim at lipowsky dot de  2005-12-01 15:55 -------
Subject: Re:  for loop with comma operator problem

pinskia at gcc dot gnu dot org schrieb:

>------- Comment #1 from pinskia at gcc dot gnu dot org  2005-12-01 15:28 -------
>HUH? Can you give the full source/ reduced source and give a little more
>detailed explication on what is going wrong.
>
>
>  
>

in the file you can see a snapshort with two arrows to read and store 
addresses.
It is very simple source.

static BYTE CommTxBuf[COMM_BUF_SIZE];
static BYTE * CommTxBufHead = CommTxBuf;
static BYTE * CommTxBufTail = CommTxBuf;
static WORD CommTxNum = 0;

static void comm_txisr (void) __attribute__ ((interrupt ("IRQ")));
static void comm_txisr(void)
{
DWORD tmp;
BYTE n;

    if(CommTxNum)
    {
        tmp = 0;
        for (n = 0; n < 3 && CommTxNum; n++, CommTxNum--)
        {
                tmp |= (DWORD)(*CommTxBufTail) << ((n + 1) * 8);

                if (++CommTxBufTail >= &CommTxBuf[COMM_BUF_SIZE])
                    CommTxBufTail = CommTxBuf;
        }
        tmp |= (DWORD)n;

        while (comm_putchar(tmp))
            ;
    }

    VICVectAddr = 0;        // Update VIC priorities
}


-- 


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


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

* [Bug middle-end/25206] for loop with comma operator problem
  2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
  2005-12-01 15:28 ` [Bug middle-end/25206] " pinskia at gcc dot gnu dot org
  2005-12-01 15:55 ` efim at lipowsky dot de
@ 2005-12-01 16:00 ` pinskia at gcc dot gnu dot org
  2005-12-05  7:34 ` efim at lipowsky dot de
  2005-12-05  9:02 ` falk at debian dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-01 16:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-12-01 16:00 -------
(In reply to comment #2)
> in the file you can see a snapshort with two arrows to read and store 
> addresses.
> It is very simple source.

This source does not show anything, it is not a full source.  If you can read
asm, could you point out what is wrong and also could attach a source which
will compile?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug middle-end/25206] for loop with comma operator problem
  2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
                   ` (2 preceding siblings ...)
  2005-12-01 16:00 ` pinskia at gcc dot gnu dot org
@ 2005-12-05  7:34 ` efim at lipowsky dot de
  2005-12-05  9:02 ` falk at debian dot org
  4 siblings, 0 replies; 6+ messages in thread
From: efim at lipowsky dot de @ 2005-12-05  7:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from efim at lipowsky dot de  2005-12-05 07:34 -------
Subject: Re:  for loop with comma operator problem

pinskia at gcc dot gnu dot org schrieb:

>------- Comment #3 from pinskia at gcc dot gnu dot org  2005-12-01 16:00 -------
>(In reply to comment #2)
>  
>
>>in the file you can see a snapshort with two arrows to read and store 
>>addresses.
>>It is very simple source.
>>    
>>
>
>This source does not show anything, it is not a full source.  If you can read
>asm, could you point out what is wrong and also could attach a source which
>will compile?
>
>
>  
>
It needed a bit more time to found a problem.
It is NOT a problem of GCC, it is an interrupt which is from a programm 
stopped by GDB
before load the new one. The CPU Reset was deaktivated in my GDB .ini file.
Sorry.


-- 


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


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

* [Bug middle-end/25206] for loop with comma operator problem
  2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
                   ` (3 preceding siblings ...)
  2005-12-05  7:34 ` efim at lipowsky dot de
@ 2005-12-05  9:02 ` falk at debian dot org
  4 siblings, 0 replies; 6+ messages in thread
From: falk at debian dot org @ 2005-12-05  9:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from falk at debian dot org  2005-12-05 09:02 -------
(In reply to comment #4)

> It is NOT a problem of GCC

OK, let's close it, then.


-- 

falk at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2005-12-05  9:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-01 14:46 [Bug c/25206] New: for loop with comma operator problem ymonyak at lipowsky dot de
2005-12-01 15:28 ` [Bug middle-end/25206] " pinskia at gcc dot gnu dot org
2005-12-01 15:55 ` efim at lipowsky dot de
2005-12-01 16:00 ` pinskia at gcc dot gnu dot org
2005-12-05  7:34 ` efim at lipowsky dot de
2005-12-05  9:02 ` falk at debian 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).