Drupal login error message display on page by make new module
I suggest you DO NOT CHANGE DRUPAL CORE , if you want your custom validation use something like this

function usermoved_form_user_login_block_alter(&amp;$form, &amp;$form_state) {
   $form['warning'] = array(
   '#value' =&gt; t('oops'),
   '#weight' =&gt; 11
   );
  $form['#submit'][] = 'usermoved_form_submit_code';
  $form['#validate'][] = 'yourcustomvalidationfunction';
     }


and in your custom validate fuction  put your error in warning field   

 function   yourcustomvalidationfunction(&amp;$form,&amp;$form_state){
    if (your validation accure error) {
        $form['warning']['#value']= t('my error message that come in warning field') ;
       }
    }


or you can  create and initial warning  directly in validation function and not require create warning field in alter