UART Interrupt problem

I want to count events when on uart receive
and print out the received data.
What is my mistake in this code ?
I’m working on Linux with Arduino 2009,
ATmega328p, IDE018.

in my /opt/cross/avr/include/avr/iom328p.h

#define USART_RX_vect _VECTOR(18) /* USART Rx Complete */

in Atmel documentation for Atmega328p
19 0x0024 USART, RX USART Rx Complete

( 0x18 is 24 decimal)

#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>

unsigned char counter = 0; 
unsigned char result = 0;

void setup() {
  Serial.begin(115200);
}

void loop() {
  delay(1000);
  Serial.print(counter, DEC);
  Serial.print(" - ");
  Serial.println(result, DEC);
}

ISR(USART_RX_vect) {

  counter++;
  result = UDR0;
}

/*
SREG     : 10100010
UCSR_A   : 1000010
UCSR_B   : 10011000
UCSR_C   : 110
UBRR_H   : 0
UBRR_L   : 10000

already tried:
ISR(USART_RX_vect)      compile error, multiple defs
ISR(USART0_RX_vect)     don't work
ISR(USART_RXC_vect)     don't work
ISR(USART0_RXC_vect)    don't work
*/

This works very nice on 115200 Baud

#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

volatile unsigned char counter = 48; 
volatile unsigned char result = 0; 

void setup() {
  sbi(UCSR0A, U2X0);
  sbi(UCSR0B, RXCIE0); 
  sbi(UCSR0B, RXEN0); 
  sbi(UCSR0B, TXEN0);
  UCSR0C = B00000110;
  UBRR0H = B0;
  UBRR0L = B00010000;
}

void loop() {
  delay(300);
  uart_send(counter);
  uart_send(9);        //TAB
  uart_send(result);
  uart_send(10);       // LF
  //uart_send(13);       // CR
}
  
ISR(USART_RX_vect)  {
   counter++;
   result = UDR0; 
}


void uart_send(unsigned char dat) {
  while(! (UCSR0A & ( 1 << UDRE0))  );  // until dararegister is NOT empty 
  UDR0 = dat;                           
}

unsigned char uart_read() {
  while(!  (UCSR0A & (1 << RXC0)) );  // until Receive complete is NOT complete 
  return UDR0;
}

Hi, To handle global variables correctly in interrupts they must be declared volatile. Examining the assembler/machine code generated with/without the optimizer would show exactly what is happening. Also, see code in .../hardware/arduino/cores/arduino/wiring.c for another interrupt example.

volatile unsigned char counter = 0;
volatile unsigned char result = 0;